Mega Code Archive

 
Categories / C / Code Snippets
 

String copy assign the pointer value

#include <stdio.h> #include <string.h> int main(void) { char *p = "stop"; char str[100]; do { printf("Enter a string: "); gets(str); } while(strcmp(p, str)); return 0; }