Hi,
I need help again. This wouldn't compile. The compiler pointed to statement in red. The error msg said "parse error before '.' token.
thanks in advance
#include <stdio.h>
struct msg {
char *p1;
char *p2;
} myptrs;
myptrs.p1 = "teach yourself C.";
myptrs.p2 = " by sams publishing.";
int main()
{
printf("%s\n", myptrs.p1);
system("PAUSE");
return 0;
}
I need help again. This wouldn't compile. The compiler pointed to statement in red. The error msg said "parse error before '.' token.
thanks in advance
#include <stdio.h>
struct msg {
char *p1;
char *p2;
} myptrs;
myptrs.p1 = "teach yourself C.";
myptrs.p2 = " by sams publishing.";
int main()
{
printf("%s\n", myptrs.p1);
system("PAUSE");
return 0;
}