Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

help me [i have in syntax]

syntax

  • Please log in to reply
12 replies to this topic

#13 Aereshaa

Aereshaa

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 638 posts

Posted 15 June 2009 - 07:35 AM

Here's the problem: dev-cpp is a C++ compiler, not a C compiler. it should be just "name" & "color".
so here is the correct way:
#include <stdio.h>
int main()
{
	char name[20];
	char color[20];
	printf("What is your name?");
	scanf("%s", name);
	printf("What is your favorite color?");
	scanf("%s", color);
	printf("%s's favorite color is %s\n", name, color);
}
I have attached a screenshot.

Attached Thumbnails

  • Screenshot-Terminal.png

  • 0
Watches: Nanoha, Haruhi, AzuDai. Listens to: E-Type, Dj Melodie, Nightcore.
"When people are wrong they need to be corrected. And then when they can't accept it, an argument ensues." - MeTh0Dz





Also tagged with one or more of these keywords: syntax

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download