gcc doesn like double quotes ¨
Recently installed UBUNTU on my Dell laptop. Just started using the gcc compiler. For some reason I getting the following error messages:
main.c:9: error: stray ‘\302’ in program
main.c:9: error: stray ‘\250’ in program
main.c:9: error: stray ‘\302’ in program
main.c:9: error: stray ‘\250’ in program
main.c:9: error: ‘X’ undeclared (first use in this function)
main.c:9: error: (Each undeclared identifier is reported only once
main.c:9: error: for each function it appears in.)
main.c:11: error: stray ‘\302’ in program
main.c:11: error: stray ‘\250’ in program
main.c:11: error: expected expression before ‘%’ token
main.c:11: error: stray ‘\302’ in program
main.c:11: error: stray ‘\250’ in program
Line 9 is ch =¨X¨;
Line 11 is printf(¨num = %d¨,num);
This is a simple, or so I thought test program that I trying to compile - most of which I copied out of a book titled
TEACH YOURSELF C.
Here is the full program:
#include <stdio.h>
#include <math.h>
int main(void)
{
char ch;
int num;
ch =¨X¨;
num = 100;
printf(¨num = %d¨,num);
return 0;
}
I invoke gcc with the following command line:
gcc main.c -o myapp
Not sure if
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Greg Davis for more information if necessary.