fork(43) download
  1. #include<string.h>
  2. int main()
  3. {
  4. char *str1 = "string Literal";
  5. const char *str2 = "string Literal";
  6. char source[]="Sample string";
  7.  
  8. strcpy(str1,source);
  9. strcpy(str2,source);
  10.  
  11. return 0;
  12. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
cc1: warnings being treated as errors
prog.c: In function ‘main’:
prog.c:9: error: passing argument 1 of ‘strcpy’ discards qualifiers from pointer target type
stdout
Standard output is empty