Is it possible to cast vector3df to a char? When i make an explicit cast i get this error:
Code: Select all
cannot convert from 'const irr::core::vector3df' to 'char'
Code: Select all
cannot convert from 'const irr::core::vector3df' to 'char'
Code: Select all
stringc str( vec.X );
str += "x";
str += vec.Y;
str += "x";
str += "vec.z;
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Thanks, it works =)Sylence wrote:Code: Select all
stringc str( vec.X ); str += "x"; str += vec.Y; str += "x"; str += "vec.z;
Code: Select all
s32 sep1 = str.findFirst('x');
s32 sep2 = str.findNext('x', sep1+1);
vec.X = atof( str.subString(0, sep1).c_str() );
vec.Y = atof( str.subString(sep1+1, sep2-sep1-1).c_str() );
vec.Z = atof( str.subString(sep2+1, str.size()-sep2-1).c_str() );
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Code: Select all
char buf [256];
// vector to string
sprintf ("x=%f y=%f z=%f", v.X, v.Y, v.Z);
// string to vector
sscanf ("x=%f y=%f z=%f", &v.X, &v.Y, &v.Z);