HELP!! (kind of repetitive, yes.)

M

MC felon

hello.
i tried this for a simple push_back action..... it says "ostream - no
such file or directory"

#include <iostream>
#include <conio2.h>
#include <string>
#include <ostream>
int main()
{
clrscr();
std::cout<<"rough engine of ecod\n\n";
std::cout<<"please input text\n\n";
std::cout<<"when you have completely typed in the message, please
press enter\n\n";
std::string str;
getline(std::cin,str,'\n');
str.push_back('\n');
std::cout<<str;
}

compiler error: ostream: no such file or directory
what am i supposed to do?
 
J

John Carson

Not just repetitive, dumb too. Try giving your posts subjects that actually
convey useful information.
hello.
i tried this for a simple push_back action..... it says "ostream - no
such file or directory"

#include <iostream>
#include <conio2.h>
#include <string>
#include <ostream>

Let's see now. What are the possibilities?

Either the ostream header exists on your system or it doesn't.

If it does exist, then presumably there is some problem with the way you
have set up directories in your IDE so the file isn't being found. If it
doesn't exist, then either there is a problem with your installation or you
have a non-standard implementation. Either reinstall or get a different
implementation, as appropriate.

Just by the way, you rarely need to #include <ostream> directly. Just
#including <iostream> normally suffices. You might try simply removing
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

hello.
i tried this for a simple push_back action..... it says "ostream - no
such file or directory"

#include <iostream>
#include <conio2.h>
#include <string>
#include <ostream>
int main()
{
clrscr();
std::cout<<"rough engine of ecod\n\n";
std::cout<<"please input text\n\n";
std::cout<<"when you have completely typed in the message, please
press enter\n\n";
std::string str;
getline(std::cin,str,'\n');
str.push_back('\n');
std::cout<<str;
}

Removing the #include <conio2.h>, clrscr(), and fixing the linebreak
this compiles perfectly fine for me. If this is really the code that
fails you have a problem with your environment and will have to look for
support somewhere else.
 
K

Kai-Uwe Bux

MC said:
hello.
i tried this for a simple push_back action..... it says "ostream - no
such file or directory"

#include <iostream>
#include <conio2.h>
#include <string>
#include <ostream>
int main()
{
clrscr();
std::cout<<"rough engine of ecod\n\n";
std::cout<<"please input text\n\n";
std::cout<<"when you have completely typed in the message, please
press enter\n\n";
std::string str;
getline(std::cin,str,'\n');
str.push_back('\n');
std::cout<<str;
}

compiler error: ostream: no such file or directory
what am i supposed to do?

I cannot reproduce that error from your code. It would appear that your
compiler is not set up correctly and does not find some of the standard
headers. You should post your problem in a forum where the quirks of your
particular compiler are topical.


Best

Kai-Uwe Bux
 
M

MC felon

Not just repetitive, dumb too. Try giving your posts subjects that actually
convey useful information.

i'll try. only that i'm such a newbee that i'm still struggling to make
the major shift from turbo c++ to a STANDARD compiler.
thanks anyway, i'm switching to CODE::BLOCKS RC1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Crossword 2
CIN Input #2 gets skipped, I don't understand why. 1
TF-IDF 1
I need help 1
Lexical Analysis on C++ 1
HELP! 9
surprise 0
Crossword 14

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top