I have tried to convert a color code by reading a file, retrieve the color code and store it as a string. This works, but when I tried to just simply convert it to an int, it doesn't work - always getting 0 when I do a cout.
string value = "0xFFFFFF";
unsigned int colorValue = atoi(value.c_str());
cout << colorValue << endl;
as you can see, the color I've got is 0xFFFFFF, but converting it to an int will only give me 0. Can someone please tell me what I'm missing or what i'm doing wrong?
Thanks