On both pages, you'll see that there are code examples of how to use the function. Both examples have the following line near the top of the code:
#include <string> // std::string, std::to_string
Unfortunately, different programming environments may have different requirements regarding this include statement. The function is part of the standard C++ library, but you may (or may not) have to put this include directive in your code.
- On Monday, I did not have to put this line in my Xcode file.
- Others have reported they must use this line if using DevC++.
- Visual Studio? I have no reports.
- Unix? I have no reports.
In the future, it's a good idea to always include <iostream>, <string>, <cmath>, and starting soon, <vector>.
No comments:
Post a Comment