DevC++ error
I'm doing a project in DevC++ right now( a greeting, user puts in their name and the computer prints a greeting for them), but I keep getting two errors when compiling. Error 1 is:3 C:\Dev-Cpp\textgame.cpp expected unqualified-id before '{' token . Error 2 is:3 C:\Dev-Cpp\textgame.cpp expected `,' or `;' before '{' token . Here's the source.
{
printf("welcome, type your name:")
scanf("%s",&n);
printf("hello %s")
}
Tell me what I am doing wrong please. This happens on all of my programs from having { printf("hello world"), to {scanf("%d",&a);printf("you entered %d")
1.) Are you including the right headers? (#include <stdio.h>)
2.) Are you typing int main() right before the first {?
2.) Are you typing int main() right before the first {?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement