Can some1 please point me to a website that teaches converting? Example: from int to char, etc.. :)
Printable View
Can some1 please point me to a website that teaches converting? Example: from int to char, etc.. :)
Code:int IntValue = 64;
char CharValue = (char)IntValue;
char* CharArrayValue = "123";
int IntValue2 = atoi(CharArrayValue);
In general there are four solution to type conversion in C++.
static_cast
reinterpret_cast
const_cast
dynamic_cast
Kuphryn
arent we forgetting conversion operators and non-explicit single argument constructors. Also constructors with default params.
There is much more to this subject than first meets the eye.
You will learn a lot here
:) I never did know the difference between the 4 types. In fact, I never knew there were 4 types :D