I tried with the following code:
#include<stdio.h>
int main()
{
char *a;
scanf("%s",a);
printf("%s",a);
return 0;
}
I can enter a string but nothing is printed in the screen.
I tried with the following code:
#include<stdio.h>
int main()
{
char *a;
scanf("%s",a);
printf("%s",a);
return 0;
}
I can enter a string but nothing is printed in the screen.
By allocating some memory before using it.
char *a;
a=malloc(sizeof(char)*10);
scanf("%s",a);
printf("%s",a);
return 0;
char *a = (char *) malloc(512 * sizeof(char));
c is rigorous you should do all the preliminary work