CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #1
    Join Date
    Mar 2009
    Posts
    13

    newbster question Name.size

    Trying to use Name.size() to find out how many characters the user puts in. Name is a string::std can I not use .size for this? how can I accomplish this feat.

    Code:
    for (i=*Name.size(); i>0; --i)
    	{
    		//need to bring this to main()	
    		*Reverse=*Reverse+*Name[i];
    	}
    Error
    Code:
    c:\documents and settings\administrator\my documents\visual studio 2005\projects\reverseit\reverseit\function.cpp(21) : error C2228: left of '.size' must have class/struct/union
            type is 'std::string *'
            did you intend to use '->' instead?
    what is the '->' that the error is mentioned?
    Last edited by ArmlessBastard; April 6th, 2009 at 01:12 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured