neef u help

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2005
Posts: 18
Reputation: wu7jian is an unknown quantity at this point 
Solved Threads: 0
wu7jian wu7jian is offline Offline
Newbie Poster

neef u help

 
0
  #1
Aug 3rd, 2005
#include<iostream>
#include<string>
using namespace std;
void main()
{
string str="hello world";
string::const_iterator p=str.begin();
while(p!=str.end())
{
cout<<*P<<endl;
p++;
}
}
when i try to run this program.it doesn't working.
it tells me the 'p' is not declared identifier.

string::const_iterator p//the defination is wrong?
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 466
Reputation: winbatch is on a distinguished road 
Solved Threads: 18
winbatch's Avatar
winbatch winbatch is offline Offline
Posting Pro in Training

Re: neef u help

 
0
  #2
Aug 3rd, 2005
You capitalized P in the cout but it was lower case p before.

(Also, main is supposed to return int, but that's an unrelated problem)
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,823
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 748
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: neef u help

 
0
  #3
Aug 3rd, 2005
>it tells me the 'p' is not declared identifier
No, it tells you that P is not a declared identifier. Notice the difference in case and remember that C++ is case sensitive.
New members chased away this month: 3
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 18
Reputation: wu7jian is an unknown quantity at this point 
Solved Threads: 0
wu7jian wu7jian is offline Offline
Newbie Poster

Re: neef u help

 
0
  #4
Aug 3rd, 2005
winbatch and narue.
both of you.
thank you very much.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC