cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
first program
first program
Sep 19, 2009 at 7:48pm UTC
blake239
(7)
#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...
Sep 19, 2009 at 7:52pm UTC
Duthomhas
(13206)
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!
Sep 19, 2009 at 8:07pm UTC
blake239
(7)
it is saying gotoxy is undeclared to i am not sure of the function for goto
Sep 19, 2009 at 9:04pm UTC
Duthomhas
(13206)
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
Sep 19, 2009 at 9:07pm UTC
Topic archived. No new replies allowed.