im new to c++ and working on a console app.
i still cant grasp pointers and 'char *'s fully.. so im using cstring header file and using 'string's (however devC++ doesnt bold it like other data types
), but thats a whole other story.
i have a function that returns a float value and prints it in a table i made. but if the value is, say 1.2 and another value is 11.5 then the tables alignment gets all screwed up. i looked briefly for a padding type of function so the table's columns would always line up, without success.
so i thought of a different method, was to either convert the float to a string or make a string with the floats value in it, count the length of that string, then i could do the rest (insert spaces as need be, to be sure all cells are X characters long). sounded like a good idea to me, but i dont know how to convert float -> string. and i dont even know how to concatenate a string with another value. i figured it was simple like java but i cant even figure it out.
iv checked afew sites and cant find out how to convert float to string. how come i can find so many functions that convert char to int,double,float etc.. but cant do the other way around?
any help appreciated, thanks.