how to create a C++ program using void

i have a C++ program but i created it using int main()

it turns out now that my professor wants it in void main()

does the structure stay the came or change?
It stays the same, however void main() is incorrect.
You should drop the course if possible, as your professor is clearly incompetent.
If you are interested in learning C++, you should buy yourself a book such as the C++ Primer.
the complier that we must use for the class says that it has to be in void form but the complier i have in my computer tells me that the int main form i have is correct.
Yours is correct. The one you're using at university is probably horribly outdated, as is your course.
Ever since the first C++ standard which was published in 1998, int main() is the only correct form - before the standard, every compiler vendor essentially did what they wanted, some allowed or even required void main().

The one you're using at university is probably horribly outdated

Let me guess; is it Dev-C++? :)
no the one my school uses is the complier for an invitation to computer science.

the one i have on my computer is the updated version of Dev-C++
Not even the compiler that comes with Dev-C++ allows void main().

I bet your proffesor is also teaching #include<iostream.h>.
yes he is and i do not understand i i have till midnight tonight to have two programs created in #inclede<iostream.h> form
Let me guess; is it Dev-C++? :)
ico

Dev-Cpp is an IDE, not a compiler. And I don't think it's that old... of course its outdated, but the MinGW version it ships with is from 2003 or so. They are probably using some ancient borland C++ or something the like.

At OP: You can officially tell your prof to get another job. There are things that are forgivable, not abiding to the standards over ten years after they are out is not. I mean, it's not even deprecated - it's ILLEGAL.
Use the tutorials on this website, they're great for beginners.
Topic archived. No new replies allowed.