Im new to C and simply want to format a floating point number but i keep getting the wrong output.
char DiamString[10];
void AddDiam (float diameter, void *LineNum)
{//Takes the diameter...
Type: Posts; User: oopli
Im new to C and simply want to format a floating point number but i keep getting the wrong output.
char DiamString[10];
void AddDiam (float diameter, void *LineNum)
{//Takes the diameter...
I tried itoa(addr_str,my_address,10); but this outputted a 41 which is 0x31 in decimal :\
I dont think itoa would work for what im doing
OK i tried,
addr_str[0]=my_address;
addr_str[1]=0;
strcat(response_buffer, addr_str)
and now i get the correct output!!
thanks for your tips!!
[QUOTE=MK27;1092361]Is the the variable a null terminated string, ie:
char my_address[] = { 0x31, 0 };
That is the only thing that will work there.
my_address is just a char variable,...
thanks for the replies, i almost have it working. Im only having trouble getting the device address that i enter in hyperterminal into the formattted string. When i step through my program the strcat...
Yes, im new to c but im learning a lot everyday. Im programming a microcontroller on an embedded device and when i use sprintf i exceed the maximum loop time thats governed by the ADC. The strings...
How can i format my strings without using sprintf? I cant use sprintf because i found it takes too much execution time. Im writing the strings to hyperterminal.