The following code was compiled on the the codeblocks gcc compiler with
-wall
-wall(extra)
-pedantic
all on.
The code compiles and the exe runs fine.
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *p = "123456789";
char *q = "abc";
char str[20];
int x,len,len2;
strcpy(str,p);
strcat(str,q);
len = strlen(p);
len2 = strlen(str);
x = strcmp(str,p);
printf("string length %d %d %d",len,len2,x);
getchar();
return 0;
}
The build log ( containing no errors or warnings) is.
Checking for existence: C:\Documents and Settings\windows\My Documents\C Programs\test\bin\Debug\test.exe
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "C:\Documents and Settings\windows\My Documents\C Programs\test\bin\Debug\test.exe" (in C:\Documents and Settings\windows\My Documents\C Programs\test\.)
Process terminated with status 0 (0 minutes, 5 seconds)