i have this error while compiling the programm.
Below is the code and thank zou in advance ;)
Below is the code and thank zou in advance ;)
Code:
#include<stdio.h>
#include<stdlib.h>
int main()
{
char* A = 0;
char* tmp = 0;
size_t size =0;
char c = 0;
while((c = fgetc(stdin)) != EOF)
{
size ++;
tmp = (char*)malloc(size);
A = (char*)realloc(A,size);
A[size-1] = c;
free(tmp);
}
for( size_t i=size ;i>0;i--)
{
printf("%c",A[i]);
}
printf("\n");
free(A);
return 0;
}
Comment