Search:

Type: Posts; User: rstanley

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. You are also in the wrong forum to ask about a...

    You are also in the wrong forum to ask about a C++ code question

    This is the forum to discuss the C Programming Language only.
  2. Replies
    3
    Views
    263

    That warning is legit. The compiler thinks you...

    That warning is legit. The compiler thinks you meant to use '==' instead of '='.
    Two options:

    ...
    if ((fname = fopen("a.txt", "r"))) {
    ...

    or

    #include <stdio.h>
  3. Replies
    11
    Views
    509

    You eliminated the checks to see if the fopen()...

    You eliminated the checks to see if the fopen() calls worked correctly. You should always check the return from fopen(). (And many other Standard Library functions!) If the file does not open...
  4. Replies
    11
    Views
    509

    Two other problems from your code above: ...

    Two other problems from your code above:

    destination = fopen("//server//folder//filename.txt","w");
    if(source==NULL)
    {
    printf("File error!");
    return 1;
    }

    Do you see a problem?
  5. Function prototypes (function declarations) in a...

    Function prototypes (function declarations) in a .h file included in both module .c files. A good book on the C programming language will explain this and other features you need to know especially...
  6. Replies
    1
    Views
    190

    We cannot and do not write your code for you...

    We cannot and do not write your code for you especially for a homework assignment, or a test.

    You need to write a first attempt, and post the code here if you have problems or questions.

    The...
  7. Replies
    3
    Views
    245

    First of all, this is a forum for the discussion...

    First of all, this is a forum for the discussion of C, and not C++ or other languages.

    That said, I would strongly recommend learning C thoroughly first, from a qualified instructor, or from an up...
  8. Replies
    3
    Views
    250

    Without seeing more details about the program, I...

    Without seeing more details about the program, I would use "weapon" as an index to an array of whatever "OBJ_EQ_DWARVEN_CROSSBOW" and other similar constants represents. You then could then reduce...
  9. I may have read some incorrect documentation many...

    I may have read some incorrect documentation many years ago.

    I stand corrected.
  10. First of all, you cannot assume the order of the...

    First of all, you cannot assume the order of the members of a struct, in memory, despite the order you specify.

    If the char is first in memory, then the int will by default, align on the next int...
  11. double *pCurrentDiscountPercentage = 0; int*...

    double *pCurrentDiscountPercentage = 0;
    int* pintYearsEmployed = 0;
    double *psngAmountPreviousPurchase = 0;
    char *pcharEmployeeStatus = 0;
    double *psngTodaysTotalPurchase = 0;


    Where are you...
  12. Replies
    3
    Views
    321

    The documentation for the Library and functions...

    The documentation for the Library and functions would have provided this information and more!
  13. See my previous response! If the program is...

    See my previous response!

    If the program is called with NO COMMAND LINE ARGUMENTS, then attempting to access argv[1], argc[2], argc[3], ... is ILLEGAL!!! You can ONLY access argv[0] through...
  14. If the program is called with no arguments to the...

    If the program is called with no arguments to the program, then accessing argv[1] or higher would be illegal.

    Us the following to display the command line arguments:

    #include <stdio.h>

    int...
  15. Replies
    4
    Views
    319

    I would strongly urge you to learn C thoroughly...

    I would strongly urge you to learn C thoroughly first. Then if you want to learn C++, you would be better prepared to learn and concentrate on the concepts of C++.

    Starting with C++, would not...
  16. Replies
    8
    Views
    308

    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>...
  17. Replies
    21
    Views
    849

    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.
  18. Thread: A .txt file.

    by rstanley
    Replies
    5
    Views
    441

    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...
  19. Replies
    6
    Views
    302

    See my response to your other post here...

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

    by rstanley
    Replies
    5
    Views
    441

    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...
  21. Replies
    3
    Views
    238

    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...
  22. Replies
    12
    Views
    403

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