Search:

Type: Posts; User: codepoet

Search: Search took 0.01 seconds.

  1. Replies
    18
    Views
    2,465

    void openFile ( char *filename ); ... ...

    void openFile ( char *filename );

    ...

    openFile ( argv[1] );
  2. Replies
    16
    Views
    3,919

    i don't care if the standard says he should stand...

    i don't care if the standard says he should stand on one foot and hop around the room while coding main. he didn't ask "how can i make my code more C99 compliant?", he asked about reading data files...
  3. Replies
    16
    Views
    3,919

    seriously man, get over it. ignoring the...

    seriously man, get over it.

    ignoring the question he asked and criticizing something as trivial as his coding style doesn't accomplish anything except make you look condescending, arrogant, and...
  4. Thread: Helppp

    by codepoet
    Replies
    6
    Views
    1,289

    - use two loops, one with fgets() to loop through...

    - use two loops, one with fgets() to loop through the sentences, and one with strtok() to split each sentence into words
    - total_words variable that increments by 1 inside the 2nd loop as you find...
  5. Replies
    4
    Views
    1,178

    you can write your own printf wrapper function,...

    you can write your own printf wrapper function, using a va list and vsnprintf, then just do something like ( console size - length of string ) / 2 to find out how much whitespace to output before...
  6. Replies
    7
    Views
    1,436

    in that case, here is a solution better suited...

    in that case, here is a solution better suited for higher values of ARRAY_SIZE, as well as being more efficient by limiting the number of calls to rand() to just ARRAY_SIZE...



    #include...
  7. Replies
    30
    Views
    4,370

    you're right, i did miss it! sorry... and i...

    you're right, i did miss it! sorry...

    and i didn't see that anywhere, i was trying to bring you two back on topic. you seem to have veered off on a related tangent, but it wasn't applicable to...
  8. Replies
    30
    Views
    4,370

    no, i'm not missing the point; i'm afraid both of...

    no, i'm not missing the point; i'm afraid both of you are. you can't input 0 into x and have it come out 0.0000001. the inaccuracy of floating point numbers doesn't apply to zero, and the computer...
  9. Replies
    7
    Views
    1,436

    maybe something like this... #include...

    maybe something like this...



    #include <stdlib.h>
    #include <time.h>

    #define ARRAY_SIZE 9

    int array[ARRAY_SIZE] = {0};
  10. Replies
    14
    Views
    21,115

    i don't see why some people don't like it... it's...

    i don't see why some people don't like it... it's very easy to use, and works great (as long as you validate your string before calling it).
  11. Replies
    14
    Views
    21,115

    1) read in one line using fgets() 2) loop...

    1) read in one line using fgets()
    2) loop through the line by using strtok() to split it up, delimited by spaces
    3) while in the loop, process each word
    4) rinse and repeat until all your lines...
  12. Replies
    30
    Views
    4,370

    yes, i know. however, zero of any magnitude is...

    yes, i know. however, zero of any magnitude is still zero, and unary negation should still fit the bill in this case (!0, !0.0, !0.0000, etc should all still return 1).
  13. Replies
    30
    Views
    4,370

    the original poster wanted to compare variables...

    the original poster wanted to compare variables to absolute zero, not zero within a tolerance (at least that's how i interpreted his code), so i don't understand why you guys are providing solutions...
  14. Replies
    9
    Views
    1,174

    it's not annoying; forums like this exist with...

    it's not annoying; forums like this exist with the primary goal of sharing knowledge via q&a format. besides, i can about guarantee that anyone with the ability to answer your question probably had...
Results 1 to 14 of 14