Search:

Type: Posts; User: rstanley

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    142

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

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

    Please compare Lines 9, and 16 in the code listing above.
  3. 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...
  4. Replies
    3
    Views
    163

    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...
  5. Replies
    4
    Views
    240

    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...
  6. Replies
    4
    Views
    240

    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...
  7. I once reviewed a book for potential use in a...

    I once reviewed a book for potential use in a course on C. The book was not just badly written, some of the text and code were plain WRONG! Please recycle the book you currently have.

    Please see...
  8. Replies
    4
    Views
    130

    Have you studied the chapter on functions, as...

    Have you studied the chapter on functions, as well as all the chapters that came before? If so you should have all the information you need to do the exercise.

    If you need a better book on C, can...
  9. A variable definition is usually also a...

    A variable definition is usually also a declaration, unless an extern declaration has already been seen by the compiler.

    #include <stdio.h>

    extern int z; // Declaration only, not a definition...
  10. Replies
    4
    Views
    162

    Please post the code you have done, so far, using...

    Please post the code you have done, so far, using [ CODE ] tags, so we can comment on it and guide you for the next steps. Please don't post a link to the code.

    Please read the FAQ at the top of...
  11. You placed a '{' char before main() not after.

    You placed a '{' char before main() not after.
  12. Also look at the printf() statement for the 2nd...

    Also look at the printf() statement for the 2nd child and find the extraneous " in the data.
  13. Replies
    2
    Views
    180

    Without seeing the code we cannot comment on the...

    Without seeing the code we cannot comment on the error.

    Why would you need an alternative to string.h?

    Turn on your warnings in the compiler, and turn up the warning level to the highest level....
  14. Replies
    2
    Views
    159

    If you are correcting/maintaining an existing C...

    If you are correcting/maintaining an existing C application, or adding some functionality, you should use the Standard that was used to compile that app. Check the Makefile or documentation to...
  15. Replies
    1
    Views
    124

    You don't "have" to put anything in a header file...

    You don't "have" to put anything in a header file you create, if your program consists of only one .c file.

    If your program has multiple .c files with function definitions and function calls in...
  16. They are two different variables, the local in...

    They are two different variables, the local in the stack segment, and the global in the global data segment! The local will HIDE the global of the same name, and you, or someone else maintaining...
  17. @gajya In C, a local variable of the same name...

    @gajya

    In C, a local variable of the same name as a Global variable, will hide the Global.

    Simple solutions:

    1) Don't use global variables if at all possible! Define them in main() (Or...
  18. The scope resolution operator is only for C++ not...

    The scope resolution operator is only for C++ not C. There may be compilers that allow this as an extension, but not gcc using -std=c18. I have not experimented with any other options.
  19. @elonmusk The two books I recommend are as...

    @elonmusk

    The two books I recommend are as follows:

    C Programming, A Modern Approach
    Author: K. N. King

    C Primer Plus, 6th Edition
    Stephen Prata
  20. Replies
    7
    Views
    195

    Following the style of your code, this might be...

    Following the style of your code, this might be my version:

    #include <stdio.h>
    #include <ctype.h> // For isspace()

    /**
    ** This version still has it's problems.
    ** Empty line, just the...
  21. Replies
    7
    Views
    195

    I do see why you initialize words to 1; I would...

    I do see why you initialize words to 1; I would have written this a little differently.
  22. Replies
    7
    Views
    195

    You have several problems here. When your...

    You have several problems here.

    When your first getchar() gets a space, the second gets the next char after the space, turning the whole line into one big word!

    Look at the following with my...
  23. Replies
    3
    Views
    179

    Actually you could input them using command line...

    Actually you could input them using command line arguments, but outputting them would be the trick! ;^)

    $ ./prog Tuesday Wednesday ...

    Also, in your code, you are overwriting each word with the...
  24. Replies
    3
    Views
    179

    The C language consists of aproximatly 44...

    The C language consists of aproximatly 44 keywords, and approximately 47 operators, and many rules concerning them.

    All the rest are contained within the Standard Library, a set of pre-compiled...
  25. Replies
    4
    Views
    313

    @rusyoldguy We are here for advising the OP's...

    @rusyoldguy

    We are here for advising the OP's on the code that they write, not to code a possible solution for them.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4