1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help with C++ strings

  1. Mar 23, 2013 #1
    I want to know, how to make a CLASS FUNCTION to return a STRING.
    For example, taken that all variables are declared correctly.

    string personType::get() const
    {
    return firstName + " " + lastName;
    }
     
  2. jcsd
  3. Mar 23, 2013 #2
    To return a string, you just return a string. What is your real problem?
     
  4. Mar 23, 2013 #3
    The compiler write error-type
     
  5. Mar 23, 2013 #4
    There are many different types of "strings" possible in C++. Which one do you want to use?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Help with C++ strings
  1. C++ strings help (Replies: 2)

  2. Strings in C (Replies: 6)

Loading...