.at() doesn't apply to integers
If you want the first (leftmost) digit in a number you have to convert the number to a string or manipulate the number with some arithmetic.
http://stackoverflow.com/questions/17393757/how-to-retrieve-the-first-digit-of-number-efficiently
i dont want to use the way 2, only way 1, but i still have error's :(, codeblocks 16.01 C++14, if i add std:: it will say its not a member of std, i hope i will fix it succesfully :)
I'm not 100% sure but from memory codeblocks has a fault with the stdio library that has never been fixed and all the nerds who deveolped it are still trying to decide what to do. It's been going on for some time.
This was the reason I scrapped using it a few years ago and will never go back to it. There is a vast array of information about it and one I found a few minutes ago ties in with my previous experience and decision that codeblocks is rubbish.
Probably not what you want to hear but I use Xcode, VStudio and Qt. All are good and work without nonsense workarounds
AFAIK Code blocks uses g++ by default in the back end. It's (at least the current version anyway is) C++14 feature-complete. I don't normally use an IDE, but perhaps OP's compiler is out-dated.
This might be worth chasing as there are various claims of fixes and links which post date my fruitless efforts at persisting with CB a few years ago. They might have fixed it, let's hope so. Good luck with it. :)
The g++ compiler didn't add the stoX() and to_string() functions until about version 4.8 of the compiler so if the OP is using a compiler older than that they should stick to the stringstream methods of converting numbers to strings.
>> Are you sure you're telling the compiler to use C++14 (or C++ 11)?
> Im not sure
show your build command, it may be under "Build log".
something like g++ -std=c++11 foo.cpp -o foo.bin
the `-std' flag tells you which c++ version you are trying to use (if there isn't such flag, you are using c++98)
> from memory codeblocks has a fault with the stdio library that has never been fixed
an IDE should have no business there.
> i want to be able to get ANY numbers digit
¿who is giving you a number? ¿can't you start with a string?
>> The g++ compiler didn't add the stoX() and to_string() functions until about
>> version 4.8 of the compiler
> :/, idk what to say about that, :/
perhaps you should say what is your compiler version