You can also access elements like this
#include <string>#include <iostream>int main(){ std::string foo("abc"); std::cout << foo[1] << "\n";}
which will output:
b
#include <string>#include <iostream>int main(){ std::string foo("abc"); std::cout << foo[1] << "\n";}
b
Quote:Original post by Verg
Also "2Etsuja\n" isn't going to work with "atoi"
Quote:Original post by Verg
"strcmp" doesn't work like that. It works like this:
Quote:Original post by etsuja
So do I have to convert it to a string stream first because it doesn't work with a file stream.