std_lib_facilities.h file in c++

My files say invalid when I try to do it on the attachments link. I will need to create an account on some hosting site then. This was what I was afraid of.
 
2 errors in your main.cpp file.

Line 1, and missing a using directive.

Line 1, you're missing quote marks around the file.
The using directive should go right under the #include statement.

Here's the fixed code:
Code:
#include "std_lib_facilities.h"

using namespace std;

int main()
{
    cout << "Hello world!\n";
    keep_window_open();
    return 0;
}

edit: also, your header file has content in it that shouldn't be there. For some reason you have HTML code inside the header file. Go back to the file that I linked, and right click the link in my post. Pick Save Link As... option and save the file that way.
 
Last edited:
WOW! OK, I know why it worked before but not when I tried it again later. The first time I followed the link then went and browsed the site and came back later and saved it with the html in it. After you told me what to do I right clicked and saved it .h and it worked. I deleted the whole project on accident and when I re wrote it I saved the file wrong again(with html). I also forgot the quotes of course but it works now without the using namespace directive. I ommited that part because it was not in the book. Either way It worked before because you helped me and it works again because you helped me. I feel like an idiot because the error was with the way I saved the file. This inattention to detail cost me 3 days but now I can move past chp 3. Thanks again! The more I learn, the dumber I feel.
 
Not a problem, just glad to help.

We all make mistakes; best way to learn sometimes - all programmers had to start somewhere ;).
 
i found an icon that says view code i clicked it and now it links to the header
of course i had to follow directions download the premade header file and put it into documents/visualstudios/projects/whatever my project is called folder and type #include std_lib_facilities.h in my source files but the trick was clicking the view code icon the icon looks like this <>
 
i found an icon that says view code i clicked it and now it links to the header
of course i had to follow directions download the premade header file and put it into documents/visualstudios/projects/whatever my project is called folder and type #include std_lib_facilities.h in my source files but the trick was clicking the view code icon the icon looks like this <>

I suggest you create a new topic for the issue that you're having and you can be more detailed as to what exactly the issue you're having is.
 
Back
Top Bottom