Search:

Type: Posts; User: gandsnut

Search: Search took 0.00 seconds.

  1. 2D structure arrays: passing to function, declaration Q:

    This code appears to work fine. That - in spite of ongoing STRANGE 'scanf()' behavior. (to which I seem to have found a 'fix').

    I'm struggling with the function declaration:
    void...
  2. Using an fflush(stdout); in the for() loop does...

    Using an fflush(stdout); in the for() loop does fix the problem. Your observation is appreciated. I found elsewhere on the net that no fflush(); is needed if the printf() includes a newline in the...
  3. john.c: I got this from an online GCC...

    john.c:

    I got this from an online GCC resource:

    Function: unsigned int sleep (unsigned int seconds)
    The sleep function waits for seconds seconds or until a signal is delivered, whichever...
  4. sleep() call (apparently) blocking code execution

    (Ubuntu 18.04, gcc version 7.5.0)

    I don't understand why individual sleep(); calls produce the desired pause in program processing. When I put sleep(); inside a for() loop, it seems all the...
  5. Well, that's clear enough. I am working on a 'C'...

    Well, that's clear enough. I am working on a 'C' tutorial series, and this cropped up unexpectedly. Thx.
  6. Sorry, I have no idea what this means, or how it...

    Sorry, I have no idea what this means, or how it applies here. Thx.
  7. Huh. int main() acts like char main(). Whoda thunk.

    Hello:


    (Ubuntu 18.04 gcc version 7.5.0)


    Ok... here I thought; "int main()" returned an int. So I tried "return(256)" and bash ($?) reports '0'. "return(255)" reports '255'. Why does...
  8. Thanks much for the supportive, tactful comment. ...

    Thanks much for the supportive, tactful comment. Aside - what's your take on running code through some variety of 'lint'?
    I'm on Ubuntu 16.04 w/ gcc 5.4.0
  9. KFN - it's probably best you better your skills...

    KFN - it's probably best you better your skills with the guidance of the experts here.
  10. To specify, I'm seeking an advisor. Posting...

    To specify, I'm seeking an advisor. Posting code was meant to introduce my style, content.

    A thousand comments to "use the // commenting method" are all opinions. I'll listen to such
    opinions,...
  11. Since you gave your time to elaborate, I'll...

    Since you gave your time to elaborate, I'll respond in detail.

    1) thanks for suggesting "const pointers". I've never used such. I'll have to study that.
    2) prototyping main() doesn't cause an...
  12. Certainly - you see no point. With respect, I...

    Certainly - you see no point. With respect, I asked for an advisor, not individual-take critiques. Though... I respect that you and a zillion other 'C' programmers choose other code styles,...
  13. Seeking advisor for 'C' programming examples -> YouTube

    In a distant past, I did 'C' programming under many flavors of UNIX, and MS-DOS (during the Windows 3.x days). Not as a hobby, as a career.

    I am preparing 'C' programming "learning examples" with...
  14. I saw this but since it was quick to add a...

    I saw this but since it was quick to add a 'valgrind' plug-in to Code::blocks, I didn't research EF further...

    Sort of. Your Q: strikes at the heart of the project. Believe me, I'm open for...
  15. You got it. I couldn't agree more. When I...

    You got it.

    I couldn't agree more.

    When I racked up 7-8 hours debugging and researching, I went looking for alternatives. This is a one-off program for personal use. If Joe Blow finds it...
  16. The coding created so far works fine. I'll test...

    The coding created so far works fine. I'll test more extensively when the project nears completion.

    Understood about your "stick to standard C features" opinion. This was the smallest segment of...
  17. JimBlumBerg: As it happens, "xmalloc()" is...

    JimBlumBerg: As it happens, "xmalloc()" is simply a suggested wrapper for "malloc()". Sticking with the "fxxxx()" file I/O calls was attempted, resulting in many hours of troubleshooting to no...
  18. Having probs with segmentation faults on fclose()? Possible work-around

    Hello: The 'Net has helped me so much, time to try and return the favor.

    I had spent many hours debugging a file reading program that was generating segmentation fault aborts. With debugging...
  19. My bad. Good catch. I need new glasses.... ...

    My bad. Good catch. I need new glasses.... :( Thanks.
  20. Code::Blocks has Alzheimer's: "casting" warning

    Hello:

    I think my 'C' code is correct, but Code::Blocks warns with:

    "warning: cast from pointer to integer of different size"

    First, the data setups.
Results 1 to 20 of 20