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
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
#include <iostream.h>
int main()
{
cout<<"Hello";
return 0;
}
oh, one more thing. Not header files but similar thing.
does it matter if you doorCode:int main()?Code:void main()
#include <iostream.h>
int main()
{
cout<<"Hello";
return 0;
}
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.
There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!
"...The only real game I thank in the world is baseball..." --Babe Ruth
"Life is beautiful"-Don Corleone right before he died.
"The expert on anything was once a beginner" -Baseball poster I own.
Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.
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)
#include <iostream.h>
int main()
{
cout<<"Hello";
return 0;
}
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.
There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!
"...The only real game I thank in the world is baseball..." --Babe Ruth
"Life is beautiful"-Don Corleone right before he died.
"The expert on anything was once a beginner" -Baseball poster I own.
Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.
iostream.h works for me btw
but conio.h didn't so I omitted it and it worked fine
#include <iostream.h>
int main()
{
cout<<"Hello";
return 0;
}
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
#include <iostream.h>
int main()
{
cout<<"Hello";
return 0;
}