Search:

Type: Posts; User: oopli

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,508

    help with sprintf

    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...
  2. Replies
    11
    Views
    6,496

    I tried itoa(addr_str,my_address,10); but this...

    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
  3. Replies
    11
    Views
    6,496

    OK i tried, addr_str[0]=my_address;...

    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!!
  4. Replies
    11
    Views
    6,496

    [QUOTE=MK27;1092361]Is the the variable a null...

    [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,...
  5. Replies
    11
    Views
    6,496

    thanks for the replies, i almost have it working....

    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...
  6. Replies
    11
    Views
    6,496

    Yes, im new to c but im learning a lot everyday....

    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...
  7. Replies
    11
    Views
    6,496

    formatting strings w/o sprintf

    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.
Results 1 to 7 of 7