first program

#include <conio.h>//need for getch and putch
void startup()

int main()
{
startup();

gotoxy ( 10,5 );
putch ( 'a' );
gotoxy( 20,10 );
putch ( 'b' );
gotoxy (30,15 );
putch ( 'c' );

getch();
return 0;
}
void startup()
{
textmode ( c80 );
textattr( 23 );
clscr();
}


//my teacher gave me this program but it doesnt work what needs to be added
//expected init declorator before "int" error etc...
Your teacher left the semicolon off of the end of line 2. It should be:
void startup();
See the section on Declaring Functions at the end of this page http://www.cplusplus.com/doc/tutorial/functions2/

Good luck!
it is saying gotoxy is undeclared to i am not sure of the function for goto
He's programming using one of Borland's old C++ compilers.

Oh, wait, you're the OP.

The gotoxy() function is only valid when you are using something like Borland's old Turbo C/C++ compiler.

You'll need to either use the same thing (see http://edn.embarcadero.com/museum/antiquesoftware )

or you'll have to update to use modern code. Since your professor is using Windows... you might as well use the Win32 Console Functions
http://www.google.com/search?btnI=1&q=msdn+Console+Functions

Good luck!
Last edited on
Topic archived. No new replies allowed.