OK. I have been wondering.
can you door does it have to beCode:#include <iostream>
?Code:#include <iostream.h>
Is itorCode:#include <conio.h>
?Code:#include <conio.c>
Thanks
Printable View
OK. I have been wondering.
can you door does it have to beCode:#include <iostream>
?Code:#include <iostream.h>
Is itorCode:#include <conio.h>
?Code:#include <conio.c>
Thanks
oh, one more thing. Not header files but similar thing.
does it matter if you doorCode:int main()
?Code:void main()
Conforming to the C++ standard, it's
#include <iostream>
int main()
and it's up to you with conio as there's no standard header with that name.
Some experts say that main should return something, hence the int in front of it.......I don't know a lot about this, but I know that prelude knows the reason behind this.......I thnk that prelude gave a whole explanation about it a while back, search around the board and you "shall" find.
but in the tutorials on this site it uses iostream.h
it also uses a header called conio.h
(they're both in the 5th tutorial about switch and case)
Quote:
Originally posted by quentin
but in the tutorials on this site it uses iostream.h
it also uses a header called conio.h
(they're both in the 5th tutorial about switch and case)
Maybe when they made the tutorials things in C++ weren't under namespaces. The reason for this is that this reduces some errors when you code or something. You can also make your own namespaces. Look up something on Namespaces for further details.
iostream.h works for me btw
but conio.h didn't so I omitted it and it worked fine
C++ was standardised in 1998, as this isn't that long ago there is plenty of documentation (tutorials, books, etc) that use the pre-standard headers. Also compilers will normally support the old headers, however this may not always be the case so if you try to compile your code in 10 years time using the iostream.h file don't be suprised if it doesn't work.
As I've already stated, there's no standard way to include a 'conio' file. It's up to the implementor and could be called anything.
main should return an int as a return value to the enviroment in which the program was run. This enviroment can then test this return value and act accordingly.
i think I understand