Search:

Type: Posts; User: rstanley

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. main() does return an int, but Linux limits the...

    main() does return an int, but Linux limits the value to the range, 0 - 255, as specified by GNU here.

    Other O/S's might allow a different range.
  2. On line 11 you are post incrementing number, then...

    On line 11 you are post incrementing number, then on the next line you are actually adding 3 to result2.
    The result is not random, just not correct.

    Could be done much simpler

    #include...
  3. Please post the actual code in [CODE] tags as...

    Please post the actual code in [CODE] tags as instructed in the forum FAQ, NOT in fuzzy images!
  4. Replies
    5
    Views
    189

    And as you quoted from C11, "5.1.2.2.1 Program...

    And as you quoted from C11, "5.1.2.2.1 Program startup"
    It clearly shows main() defined with "void" as the parameter list, when no parameters are specified.

    I stand by my statement, in a hosted...
  5. Replies
    5
    Views
    189

    Effectively, for C, there is no difference. The...

    Effectively, for C, there is no difference. The assembler code from gcc is the same from both on my system.

    For main() and all other functions, I strongly recommend using full prototypes, and...
  6. Replies
    5
    Views
    162

    QT is available under both Open Source...

    QT is available under both Open Source and commercial licenses.
  7. Replies
    1
    Views
    153

    I could do the programming for you, but your...

    I could do the programming for you, but your instructor should have given you enough information to be able to create functions, how to call them, and return values.

    If this assignment is from a...
  8. Replies
    15
    Views
    341

    Rather than asking us to go to an outside site,...

    Rather than asking us to go to an outside site, you should post the code here in CODE blocks as you are instructed in the Forum Rules FAQ.
  9. In addition to my comments above, rather than...

    In addition to my comments above, rather than using an old book, I would recommend one of the following up to date books on the C Programming Language:

    C Programming, A Modern Approach
    Author: K....
  10. @felixthunder The program could be written...

    @felixthunder

    The program could be written much simpler. getopt() is not needed. gcc seems to being used, assuming argv[0] does contain the program name.
    argc == 1, use stdin
    argc == 2, attempt...
  11. Replies
    10
    Views
    294

    Strictly speaking, the is NO "void main()"!!! ...

    Strictly speaking, the is NO "void main()"!!! main() should ALWAYS returns an int to the operating system! This is defined by the operating system.

    We cannot make any assumptions about the next...
  12. Replies
    10
    Views
    294

    @shaswat The void before the function name...

    @shaswat

    The void before the function name means no value is returned from the function. Any other data type before the function name, indicates the type of data returned.

    The data type inside...
  13. Replies
    5
    Views
    238

    Three examples I can see used are, stubbing out...

    Three examples I can see used are, stubbing out code temporarily, header file choice, and inclusion of debug code during development:

    #ifdef DEBUG
    // Code with debug statements
    #else
    //...
  14. Replies
    5
    Views
    238

    Header files should contain extern function and...

    Header files should contain extern function and extern Global data declarations, #defines, other preprocessor directives, etc..., but not executable code such as the printf statement.

    I would...
  15. The api code is there, among the "21,300,000...

    The api code is there, among the "21,300,000 results", but what me be missing is the C code you need to call these api's!

    YOU have to write this code or look in Github, Sourceforge.net, or some...
  16. A simple Google search using "screen capture api...

    A simple Google search using "screen capture api windows" would bring up "About 21,300,000 results (0.64 seconds)".

    Start with the top and examine the first, and subsequent pages and see if any of...
  17. @gajya: You need to study a good book on the C...

    @gajya:

    You need to study a good book on the C Programming Language, cover to cover, and do all the exercises at the end of each chapter! Choose one of the three listed below:

    C Programming, A...
  18. The asterisk '*' is used for two different places...

    The asterisk '*' is used for two different places and purposes.


    int *a = NULL;
    is used to create a pointer variable called a, initialized to NULL.


    a = malloc(sizeof(*a));
    This allocates...
  19. Thread: Help Required

    by rstanley
    Replies
    3
    Views
    227

    It is standard for all text files in UNIX or...

    It is standard for all text files in UNIX or Linux to always have a newline (Empty line) at the end of the file. Many utilities have problems with text files without the final newline.

    Most if...
  20. Replies
    5
    Views
    247

    A Google search...

    A Google search would bring up several options including this one, which seems to be well done. I have not tested it though.
  21. Replies
    2
    Views
    144

    Please compare Lines 9, and 16 in the code...

    Please compare Lines 9, and 16 in the code listing above.
  22. Why are the data strings, "01_01142020"? Isn't...

    Why are the data strings, "01_01142020"? Isn't that "MM_MMDDYYYY"? Seems like redundant redundancy!

    Why do you need the leading "MM_"? Why not just use the final 8 digits, "MMDDYYYY"? It is...
  23. Replies
    3
    Views
    234

    If so, no one here will do your homework for you!...

    If so, no one here will do your homework for you! YOU have make an attempt to code a solution with the skills you have been taught in class. Then post the code here with questions, and we can...
  24. Replies
    4
    Views
    345

    You might be copying from an IDE. Make sure you...

    You might be copying from an IDE. Make sure you are using plain text, not with IDE formatting.



    For main(), the two are effectively equivalent. For all other functions you create, there is a...
  25. Replies
    4
    Views
    345

    First of all, format your code properly. ...

    First of all, format your code properly. Functions are not one liners.
    Compile and run this version of the function. What do you think will happen, providing the file does exist?

    You will need...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4