954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

neef u help

#include
#include
using namespace std;
void main()
{
string str="hello world";
string::const_iterator p=str.begin();
while(p!=str.end())
{
cout<<*P<

wu7jian
Newbie Poster
18 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

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)

winbatch
Posting Pro in Training
466 posts since Feb 2005
Reputation Points: 68
Solved Threads: 18
 

>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.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

winbatch and narue.
both of you.
thank you very much.

wu7jian
Newbie Poster
18 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You