0
#include "Person.h"
#include <string>

using namespace std;

string Person::toSimpleString(){

     return getFirstName() + " " + getLastName() + ", Age " + to_string(5);
}

All of my strings are working fine but I cannot get the to_string function to work at all. Eclipse keeps telling me it is out of scope. Wht

BenMorel
  • 34,448
  • 50
  • 182
  • 322

1 Answers1

-2

Does #include <string> need to be #include <string.h>?

I think you might be missing the ".h"

ylemp
  • 318
  • 3
  • 4
  • No, [string and string.h](https://stackoverflow.com/questions/9257665/difference-between-string-and-string-h) are different. –  Oct 07 '14 at 22:40
  • Beware of the subtle difference, in C++ `#include ` is including the string class from the standard library, and **not** the standard C string manipulation functions (that can be included with `` in C++, or with `` in both languages) – Ale Oct 07 '14 at 23:25
  • Ahh wow, I didn't know there was a difference. Thanks for the corrections. – ylemp Oct 08 '14 at 15:23