From: MCheu Newsgroups: comp.os.msdos.djgpp Subject: Re: Compilation Error Organization: Metronome Message-ID: References: X-Newsreader: Forte Agent 1.92/32.572 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 50 Date: Sun, 27 Oct 2002 18:33:28 -0500 NNTP-Posting-Host: 209.188.71.240 X-Trace: localhost 1035761613 209.188.71.240 (Sun, 27 Oct 2002 16:33:33 MST) NNTP-Posting-Date: Sun, 27 Oct 2002 16:33:33 MST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Sun, 27 Oct 2002 20:31:46 GMT, "Peter" wrote: > >#include > >int main() >{ > char *str1 =new char(100); > char *str2=str1; > > cout < *str2++ = 'T'; > *str2++='E'; > cout<<"value of str1 is "< return 1; >} > > >iostrem is located in "c:\djgpp\lang\cxx\3.2\" > >I would appreciate help on resolving the issue. > >Thanks > The error might be in your code. You seem to be using the new style headers but aren't using the namespace correctly. You can either globally specify the namespace: #include using namespace std; or prefix the cout lines with std:: to specify the namespace locally. eg. std::cout <<"value of str1 is " << str1 << endl; This second style is preferred, as it's more flexible, but the first style is sometimes more convenient. ----------- Thanks MCheu