Search:

Type: Posts; User: rstanley

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    152

    Your code above won't even compile; Please...

    Your code above won't even compile;

    Please format your code with proper indentation. This is not a C Code Obfuscation contest.

    Your if else statement is illegal.

    #include <stdio.h>...
  2. Replies
    21
    Views
    416

    You need to attempt to write the code yourself,...

    You need to attempt to write the code yourself, then if you have problems, post the code so we can comment. We can't and don't write homework assignments for you.

    Please read the forum FAQ.
  3. Thread: A .txt file.

    by rstanley
    Replies
    3
    Views
    181

    We all have a "everyday routine". If you cannot...

    We all have a "everyday routine". If you cannot commit to learning the language from a qualified instructor or from an up-to-date book, then I cannot help you further. Without properly learning the...
  4. Replies
    6
    Views
    183

    See my response to your other post here...

    See my response to your other post here.
  5. Thread: A .txt file.

    by rstanley
    Replies
    3
    Views
    181

    Before you open a text file, or any other file,...

    Before you open a text file, or any other file, in C, you need to study a good book on the C Programming Language. You need a lot more knowledge about C so you know what to do after opening the...
  6. Replies
    3
    Views
    169

    Once again, I strongly recommend ignoring all...

    Once again, I strongly recommend ignoring all online tutorials, and YouTube videos, purchase a good book on the C Programming Language, updated for the latest C Standards, study each chapter, cover...
  7. Replies
    12
    Views
    254

    malloc() and calloc() will both allocate memory...

    malloc() and calloc() will both allocate memory on the heap for use by the program.

    malloc() will allocate the memory, but the all the memory allocated will contain unknown values in each byte of...
  8. When we refer to a "global" (Non-static)...

    When we refer to a "global" (Non-static) variable, it is a variable that will be visible to any function in any file as long as there is an "extern" declaration, usually in a header file. The...
  9. A lot has changed! K&R is from 1978! Many...

    A lot has changed! K&R is from 1978! Many official C Standards have been released from ANSI & ISO. You should NOT rely on K&R! It is NOT a C Standard, and a lot has been added, changed, or...
  10. 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.
  11. 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...
  12. 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!
  13. Replies
    5
    Views
    339

    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...
  14. Replies
    5
    Views
    339

    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...
  15. Replies
    5
    Views
    265

    QT is available under both Open Source...

    QT is available under both Open Source and commercial licenses.
  16. Replies
    1
    Views
    256

    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...
  17. Replies
    15
    Views
    480

    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.
  18. 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....
  19. @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...
  20. Replies
    10
    Views
    400

    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...
  21. Replies
    10
    Views
    400

    @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...
  22. Replies
    5
    Views
    347

    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
    //...
  23. Replies
    5
    Views
    347

    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...
  24. 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...
  25. 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...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4