Advertisement

wtf???

Started by January 12, 2002 11:19 AM
25 comments, last by StoNeD_TrOLL 22 years, 8 months ago
Thank you!!!So in my other files i just put in the header and go straight to the coding?like this:
#include <iostream>
{
std::cout <<"Hi!\n";
return 0;
}


Edited by - StoNeD_TrOLL on January 12, 2002 12:53:31 PM
No. You make another function, like -

  int PrintHi(){   std::cout <<"Hi!\n";   return 0;}  


Remember to use function prototypes. Have you read any books/tutorials on C++ yet?

------------------------------
Simple DirectMedia Layer:

Main Site - (www.libsdl.org)
Cone3D Tutorials- (cone3D.gamedev.net)
GameDev.net''s Tutorials - (Here)

OpenGL:

Main Site - (www.opengl.org)
NeHe Tutorials - (nehe.gamedev.net)
Online Books - (Red Book) (Blue Book)
------------------------------Put THAT in your smoke and pipe it
Advertisement
No, you create functions with names other than main.

int myReallyCoolUsefulFunction(void)
{
std::cout << "Hi!\n";
return 0;
}

Edit: Crap! You beat me to it...

Edited by - Martee on January 12, 2002 1:02:27 PM
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Sorry.

Stoned Troll, you should check out the book ''sams teach yourself c++ in 21 days.'' It''s a really great book; you''ll learn alot from it.

------------------------------
Simple DirectMedia Layer:

Main Site - (www.libsdl.org)
Cone3D Tutorials- (cone3D.gamedev.net)
GameDev.net''s Tutorials - (Here)

OpenGL:

Main Site - (www.opengl.org)
NeHe Tutorials - (nehe.gamedev.net)
Online Books - (Red Book) (Blue Book)
------------------------------Put THAT in your smoke and pipe it
Im reading a c++in twenty four hours.And Drizzt,when i do your code my complier gives me this:
Error : undefined identifier 'std'
bkla.cpp line 3 std:: cout <<"Hi!\n";



Edited by - StoNeD_TrOLL on January 12, 2002 1:07:55 PM
well?
Advertisement
Just leave out the "std::". It''s not supposed to be there.
cout is unidentified to my complier if i dont put"std::"...................none of this is working.

Edited by - StoNeD_TrOLL on January 12, 2002 4:41:08 PM
I think you need to #include <iostream.h> at the top of that file for cout to work.
The #include <iostream.h> worked but now where back to main!!!!How do you guys make a file when you already have a file with main???

Edited by - StoNeD_TrOLL on January 12, 2002 4:57:47 PM

This topic is closed to new replies.

Advertisement