error: stray ' ' in program
bonjour,
le programme suivant ne se compile pas chez moi, je travail sur code blocks
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| #include <curses.h>
#include <string.h>
int main()
{
char mesg[]="Enter a string: "; /* message to be appeared on the screen */
char str[80];
int row,col; /* to store the number of rows and *
* the number of colums of the screen */
initscr(); /* start the curses mode */
getmaxyx(stdscr,row,col); /* get the number of rows and columns */
mvprintw(row/2,(col−strlen(mesg))/2,"%s",mesg);
/* print the message at the center of the screen */
getstr(str);
mvprintw(LINES − 2, 0, "You Entered: %s", str);
getch();
endwin();
return 0;
} |
voici le code d'erreur:
Citation:
C:\Users\Administrator\Desktop\test\main.c||In function 'main':
C:\Users\Administrator\Desktop\test\main.c|11|error: stray '\342' in program|
C:\Users\Administrator\Desktop\test\main.c|11|error: stray '\210' in program|
C:\Users\Administrator\Desktop\test\main.c|11|error: stray '\222' in program|
C:\Users\Administrator\Desktop\test\main.c|11|error: expected ')' before 'strlen'|
C:\Users\Administrator\Desktop\test\main.c|14|error: stray '\342' in program|
C:\Users\Administrator\Desktop\test\main.c|14|error: stray '\210' in program|
C:\Users\Administrator\Desktop\test\main.c|14|error: stray '\222' in program|
C:\Users\Administrator\Desktop\test\main.c|14|error: expected ')' before numeric constant|
C:\Users\Administrator\Desktop\test\main.c|14|error: too few arguments to function 'mvprintw'|
||=== Build finished: 9 errors, 0 warnings ===|