Search:

Type: Posts; User: rstanley

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds; generated 59 minute(s) ago.

  1. Replies
    7
    Views
    220

    Understood. Please apply at least some of my...

    Understood. Please apply at least some of my suggestions above.

    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! ...
  2. Replies
    7
    Views
    220

    You should initialize all local variables to zero...

    You should initialize all local variables to zero or some meaningful values.

    You assume whole numbers, you should use floats or doubles for all prices and budgets. Are all fruit whole dollars,...
  3. Replies
    7
    Views
    220

    Since ItemChosen is a single char, you could use...

    Since ItemChosen is a single char, you could use a switch - case statement instead of the if statements.

    Also, I would break this single main() function into individual functions.
  4. Replies
    175
    Views
    4,415

    If you are interested in viewing C code, may I...

    If you are interested in viewing C code, may I suggest downloading and looking at the GNU coreutils to see some of the source code that makes up the Linux O/S?

    You can download the code here....
  5. Replies
    12
    Views
    322

    This forum is for the discussion of C not C++. ...

    This forum is for the discussion of C not C++. You should post in the C++ forum.
  6. Replies
    3
    Views
    222

    This would be my basic approach 1) Read one...

    This would be my basic approach

    1) Read one char at a time from stdin
    2) If char is a space, keep reading chars until a non space char or newline is input
    3) If not a newline, print out one...
  7. Replies
    3
    Views
    222

    Have you attempted to write this yourself? We...

    Have you attempted to write this yourself? We are not here to write the code for you.

    Make an attempt to write this yourself, then if you have questions or problems, post your code, and we can...
  8. Replies
    3
    Views
    236

    First of all, turn on your warnings and turn up...

    First of all, turn on your warnings and turn up the warning level to the highest level.


    scanf("%c", letter);
    Where is letter defined? Should it be "&letter"?

    return values from scanf()...
  9. Replies
    2
    Views
    208

    No! You need to make an attempt to do it...

    No! You need to make an attempt to do it yourself first, then post your attempt in Code Blocks before asking any questions.

    You should have been taught all you need to know, in order to do the...
  10. Replies
    4
    Views
    517

    From man7.org...

    From man7.org, a more accurate resource for online manpages:


    Please compare the atoi() manpage against the strol() magpage, and the example on the latter.
  11. Replies
    23
    Views
    1,246

    In order to learn the language properly, you need...

    In order to learn the language properly, you need to either take a class from a qualifed instructor, or you need to study a good up to date book on the C Programming Language, cover to cover, and do...
  12. Replies
    23
    Views
    1,246

    I don't use any IDE, but I found this: Dev-C++...

    I don't use any IDE, but I found this:
    Dev-C++ Tutorial

    I use Emacs as my editor, and either compile on the command line, or "make" for anything larger than a one source file program. Most...
  13. Replies
    23
    Views
    1,246

    Semicolons missing after declaring "int...

    Semicolons missing after declaring "int Multiplier" and "int Result".

    You can define and initialize a variable in one statement.

    int Value = 50;

    "printf" not "Printf"

    getch() is not a...
  14. Replies
    23
    Views
    1,246

    Although, I don't do MySQL development, I would...

    Although, I don't do MySQL development, I would start with this tutorial:
    MySQL C API programming tutorial

    There may be other, and possibly, better tutorials online.

    And the full reference to...
  15. Salem is far more knowledgable than you give him...

    Salem is far more knowledgable than you give him credit for! You should listen to him.

    Linux experts are currently working on the 2038 problem.

    Some UNIXs are already corrected for the 2038...
  16. 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.
  17. Replies
    3
    Views
    374

    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>
  18. Replies
    11
    Views
    728

    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...
  19. Replies
    11
    Views
    728

    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?
  20. 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...
  21. Replies
    1
    Views
    344

    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...
  22. Replies
    3
    Views
    410

    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...
  23. Replies
    3
    Views
    342

    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...
  24. I may have read some incorrect documentation many...

    I may have read some incorrect documentation many years ago.

    I stand corrected.
  25. 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...
Results 1 to 25 of 497
Page 1 of 20 1 2 3 4