I have an array holding a bunch of floats, how would i take out one element, round it up or down to 2 decimal points , stip off the decimal points and move the data into an int variable, sort of like:
float new_array[5]
int some_int
if some_action then
new_array[0]= new_array[0]*some_defign
roundup new_array[0]
strip new_array[0]
some_int = new_array[0]_stripped
Please excuse my cruddy sudo code, oh also the data held in the array should still have the decimal points also could anyone recommend a webiste that has good information / tutorial on c programmin, im currently using the one on about.com and it hardly touches the things im delving into.
Thanks again in advance for all your helps.
float new_array[5]
int some_int
if some_action then
new_array[0]= new_array[0]*some_defign
roundup new_array[0]
strip new_array[0]
some_int = new_array[0]_stripped
Please excuse my cruddy sudo code, oh also the data held in the array should still have the decimal points also could anyone recommend a webiste that has good information / tutorial on c programmin, im currently using the one on about.com and it hardly touches the things im delving into.
Thanks again in advance for all your helps.