[Coco] Re: Preparing for a job which requires knowledge of C
doctorx0079
doctorx0079 at buckeye-express.com
Sun Apr 16 01:46:54 EDT 2006
> What is the difference between main() in a C program, and main() in a C++
program?
IIRC, the answer is :
In a C program, the main() function has a return value of void. In other
words, it doesn't return any value.
In a C++ program, the main() function has a return value of int. In other
words, it must return an integer.
In C you've got
void main()
{
. .
}
In C++ you've got
int main()
{
. .
return(SOME_INT);
}
where SOME_INT is 0 or some other integer.
More information about the Coco
mailing list