Jump to content
  • Advertisement

Archived

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

maxplus305

problems with includes

This topic is 5194 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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!