Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
Okay, so I have tmp.cpp: #include <string> int main() { std::to_string(0); return 0; } But when I try to compile I get: $ g++ tmp.cpp -o tmp tmp.cpp: In function ‘int main()’: tm...
I am making a small vocabulary remembering program where words would would be flashed at me randomly for meanings. I want to use standard C++ library as Bjarne Stroustroup tells us, but I have
Okay, so I have tmp.cpp: #include <string> int main() { std::to_string(0); return 0; } But when I try to compile I get: $ g++ tmp.cpp -o tmp tmp.cpp: In function ‘int main()’: tm...
I am making a small vocabulary remembering program where words would would be flashed at me randomly for meanings. I want to use standard C++ library as Bjarne Stroustroup tells us, but I have
at the top of the file. add that and the compile error should be gone. these errors often occur because compilers often add stuff like <string> when including other stuff. for example in g++ 7.3.0, if you add #include <vector> then you can also use std::array without including <array>, but code that only includes <vector> to use std::array is non-portable, and the code may not compile on another compiler (like MSVC, for instance)... and i consider this behavior in g++ A BUG. (but the gcc devs does not, as the c++ specs technically does not forbid it. >.<)
for example, this compiles on g++ BY MISTAKE:
C++:
#include <vector>
// un-comment this to make the code portable: #include <array>
int main(){
std::array<int,5> arr;
return 0;
}
and probably does not compile on other compilers like msvc / icc / sun/Borland, where i expect people to get the error "array is not a member of std", for the same reason you're getting to_string is not a member of std here.