Thread: Question about functions of string vs char string

  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    10

    Question about functions of string vs char string

    In the using of char strings(char x[50]) you are able to assign, change, and veiw what is in the string based on position. For strings(string x) is it possible to do the same? If so, would you mind giving me examples so I can see?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Robertjh12
    For strings(string x) is it possible to do the same?
    Yes.

    Quote Originally Posted by Robertjh12
    If so, would you mind giving me examples so I can see?
    Try searching the Web for "C++ string".
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Jul 2011
    Posts
    10
    Alright, didn't think to do that, my head is a bit mixed up with code

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 06-16-2011, 11:59 AM
  2. Replies: 2
    Last Post: 09-12-2010, 09:15 AM
  3. Find index of last char in search string in string?
    By Programmer_P in forum C++ Programming
    Replies: 6
    Last Post: 06-07-2010, 06:51 PM
  4. convert char** (c string array) to std::string[]
    By umen242 in forum C++ Programming
    Replies: 2
    Last Post: 11-11-2008, 05:52 AM
  5. Char / string Question
    By cboard_member in forum C++ Programming
    Replies: 6
    Last Post: 07-11-2005, 11:16 AM