C++ School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Help with the error message Expression syntax in function main Error message keep occuring in simple program. Rate Topic: -----

#1 pappijoe  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 18-June 07


Dream Kudos: 0

Share |

Help with the error message Expression syntax in function main

Posted 18 June 2007 - 06:07 AM

i am using borland c++ 1.01 b/c i need to write c++ programs with graphics in it.
i am trying to make just a simple smiley face to send to my friends by i have a problem.
i keep getting the error message when compiling error Expression syntax in function main.

[size=4]here is my code.

// this code is pappi
//joes...
#include<iostream>
#include<conio.h>
#include<graphics.h>
#include<dos.h>

int main()
{
clrscr();

int graphdriver = DETECT, graphmode; note:This is where the problem mostly is..
initgraph(&graphdriver, &graphmode, "c:\\tc\\bgi");

do
{

cleardevice();

setcolor(DARKGRAY);
setfillstyle(1, YELLOW);

circle(320, 240, 200); //Draw the face

floodfill(320, 240, DARKGRAY); //fill the face with yellow

setlinestyle(0, 1, 3);

arc(250, 180, 0, 280, 40);

arc(320, 180, 0, 180, 40);

setlinestyle(0, 1, 3);

arc(320, 260, 200, 340, 100);

delay(1000);

setfillstyle(1, YELLOW);

circle(320, 240, 200); //the face

setlinestyle(0, 1, 3);

floodfill(320, 240, DARKGRAY);

circle(250, 180, 40); //eyes

setfillstyle(1, DARKGRAY);

floodfill(250, 180, DARKGRAY);

circle(380, 180, 40); //eyes

setfillstyle(1, DARKGRAY);

setlinestyle(0, 1, 3);

arc(320, 260, 200, 340, 100); //mouth

delay(2000);
}
while(!kbhit());

closegraph();
return 0;
}


if you could please help me that would be great...
Was This Post Helpful? 0
  • +
  • -


#2 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • Icon

Reputation: 75
  • View blog
  • Posts: 1,398
  • Joined: 25-January 07


Dream Kudos: 125

Re: Help with the error message Expression syntax in function main

Posted 19 June 2007 - 06:01 AM

Will you please put the exact error you are getting...
just copy and paste it as it is appearing in your compiler.
error description with line will make it bit easier to find the problem.
Was This Post Helpful? 0
  • +
  • -

#3 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • Icon

Reputation: 197
  • View blog
  • Posts: 13,429
  • Joined: 12-July 02


Dream Kudos: 25

Re: Help with the error message Expression syntax in function main

Posted 19 June 2007 - 06:43 AM

int graphdriver = DETECT, graphmode;


What is your intent here? Where are DETECT and graphmode defined?
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users