post the error message(s)
line 3: should be int main() -- functions require a return type.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
abov e program can also be written as:
void main()
{
------
-----
getch();
}
ajay.krish123
Junior Poster in Training
90 posts since Nov 2008
Reputation Points: 6
Solved Threads: 9
abov e program can also be written as:
void main()
{
------
-----
getch();
}
Yes, it can be...if you want your code to be subtly broken and non-portable. The main function returns int by definition. getch isn't a standard function, so you'd be relying on a library extension specific to your compiler.
The only way you could bemore completely wrong is to introduce syntax errors into one of the four "this is real code" lines of that example.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401