Help with the error message Expression syntax in function main

Error message keep occuring in simple program.

Page 1 of 1

2 Replies - 7589 Views - Last Post: 19 June 2007 - 07:43 AM Rate Topic: -----

#1 pappijoe   User is offline

  • New D.I.C Head

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

Help with the error message Expression syntax in function main

Posted 18 June 2007 - 07: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...

Is This A Good Question/Topic? 0
  • +

Replies To: Help with the error message Expression syntax in function main

#2 AmitTheInfinity   User is offline

  • C Surfing ∞
  • member icon

Reputation: 119
  • View blog
  • Posts: 1,565
  • Joined: 25-January 07

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

Posted 19 June 2007 - 07: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   User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 253
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

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

Posted 19 June 2007 - 07:43 AM

int graphdriver = DETECT, graphmode;


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

Page 1 of 1