0

my sample.c program:

#include <stdio.h>

int main()
 {
 printf(“Hello World!\n”);
return 0;
 } 

so when I want compile it I see this error :

root@Kali:~/Desktop# x86_64-w64-mingw32-gcc sample.c -o file.exe
sample.c: In function ‘main’:
sample.c:5:2: error: stray ‘\342’ in program
sample.c:5:2: error: stray ‘\200’ in program
sample.c:5:2: error: stray ‘\234’ in program
sample.c:5:12: error: ‘Hello’ undeclared (first use in this function)
sample.c:5:12: note: each undeclared identifier is reported only once for each function it appears in
sample.c:5:18: error: expected ‘)’ before ‘World’
sample.c:5:18: error: stray ‘\’ in program
sample.c:5:18: error: stray ‘\342’ in program
sample.c:5:18: error: stray ‘\200’ in program
sample.c:5:18: error: stray ‘\235’ in program

I can't compile any C format file. Please help me.

hyde
  • 55,609
  • 19
  • 114
  • 170
Danial Hosseini
  • 33
  • 1
  • 2
  • 9

1 Answers1

1

This is due to your editor . (quotation marks) and " is different and is causing error . Try with " .

#include <stdio.h>

 int main()
 {
 printf("Hello World!\n");
 return 0;
  } 

Try other code editor.

Rahul K Jha
  • 788
  • 9
  • 18