Search:

Type: Posts; User: jerryR

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    50,231

    And all this time i thought a double was a...

    And all this time i thought a double was a floating point number with 2 decimal places...anyways, thanks for the counting idea, that should work!
  2. Replies
    6
    Views
    50,231

    It does return 1 for numbers with double...

    It does return 1 for numbers with double precision, but it also returns 1 for numbers with less/more precision...ie 12.22, 12.345, 12 all return 1 and I'm trying to make sure the only input allowed...
  3. Replies
    6
    Views
    50,231

    Is there any other way to make sure the number I...

    Is there any other way to make sure the number I get from stdin is a double, since sscanf cannot do it?
  4. Replies
    6
    Views
    50,231

    sscanf with double?

    I'm trying to read a double from stdin in the following manner:

    double value;
    fgets(line, sizeof(line), stdin); // eg 12.54
    sscanf(line, "%.2f", &value);

    also tried %e, %g, %le, etc...none...
  5. Replies
    12
    Views
    1,597

    Thanks bithub..I really had no idea, I'm no good...

    Thanks bithub..I really had no idea, I'm no good with pointers :confused: (nor C in general) and I had no clue this is what was happening!

    Thanks again!
  6. Replies
    12
    Views
    1,597

    I'm sorry, i shoulnt have posted the whole code...

    I'm sorry, i shoulnt have posted the whole code to begin with as there were several other problems, but im trying to focus in on this one problem i cant get past, and i left out one line when...
  7. Replies
    12
    Views
    1,597

    Thank you for your help! Is there a reason why...

    Thank you for your help! Is there a reason why an object that's not initialized isnt automatically set to NULL in C? default values?? Anyways, after applying your changes I get this output:
    ...
  8. Replies
    12
    Views
    1,597

    OK, I hope adding "= NULL" to "stockItem *stock =...

    OK, I hope adding "= NULL" to "stockItem *stock = NULL" will help, but still not sure where stockList->symbol is being updated after adding 2nd, 3rd...etc items.
  9. Replies
    12
    Views
    1,597

    Thanks for the reply! I check if stock is NULL...

    Thanks for the reply! I check if stock is NULL because I assume that the during the first iteration it is NULL, and after iterating through the list, it'll eventually come to be NULL as...
  10. Replies
    12
    Views
    1,597

    still need help

    OK, reposted with indent and this code can be complied. Just cant seem to see where stockList->symbol is being changed after its being read from the command line...!?!
  11. Replies
    12
    Views
    1,597

    Please Help with C linked list implementation

    Ok, I originally thought the problem was with the threads but now i suspect sscanf, though i have no clue as to why, maybe someone can shed some light on the highlighted lines and the output below:
    ...
Results 1 to 11 of 11