if i use scanf() the program do not work by gets it"s work
Code:#include <stdio.h> #include <stdlib.h> int main() { char *ptr; char a[6]="mohsn"; gets(a); puts(a); scanf("%s",ptr); //if i use gets(ptr);program will be work puts(ptr); ptr=a; gets(ptr); //this gets do not get the new value ? puts(ptr); return (1); }