Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

maxplus305

problems with includes

This topic is 5274 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I think I''m missing something fundamental here:

#include <iostream>
#include "stdio.h"

int main()
{
   cout << "Hello" << endl;
}
 
Then the compiler (I''m using VC 6.0) complains that cout and endl are undeclared identifiers. What''s the basic problem here?

Share this post


Link to post
Share on other sites
Advertisement
write either


#include <iostream>
#include "stdio.h"
int main(){
std::cout << "Hello" << endl;
}


or


#include <iostream>
#include "stdio.h"

using std;

int main(){
cout << "Hello" << endl;
}

Share this post


Link to post
Share on other sites
quote:
Original post by pinacolada
write either


#include <iostream>
#include "stdio.h"
int main(){
std::cout << "Hello" << endl;
}


or


#include <iostream>
#include "stdio.h"

using std;

int main(){
cout << "Hello" << endl;
}



thats using namespace std; not using std;

and on the first one needs std::endl too.(you.read_book()

[edited by - DerAngeD on March 7, 2004 6:36:56 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by WaterMelon34
Or a simpler way:

just change:
#include <iostream>

to:
#include <iostream.h>




noooooooooooooooooooooooooo!

iostream.h is a decrewpid old header with too many globals. there is a reason that the new iso standards are used now duhhhhhh! most compilers complain about the use of decrepid headers like iostream.h and fstream.h

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!