Search:

Type: Posts; User: rstanley

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. 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...
  2. 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...
  3. Replies
    4
    Views
    192

    @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.
  4. Replies
    4
    Views
    192

    No, you would need to write that yourself. Not...

    No, you would need to write that yourself. Not that difficult.
  5. Yes, display() does return the pointer. You do...

    Yes, display() does return the pointer.

    You do not capture the return from display(). Either capture the return value, or better still, declare display() as void.


    void display(struct student...
  6. Replies
    8
    Views
    183

    Why do you feel the need to reinstall...

    Why do you feel the need to reinstall Code::Blocks? That will not correct your code!

    gets() has been removed from the C11 Standard. You should use fgets() instead. fgets() does bring in the...
  7. Blank lines between functions, and indentation of...

    Blank lines between functions, and indentation of 2, 4, or 8 spaces.

    be careful about copy, and pasting from an IDE, as some hidden formatting will screw up the Code here. Only pure ASCII text!
    ...
  8. Replies
    8
    Views
    183

    No, it's not! You don't have your warnings...

    No, it's not! You don't have your warnings turned on and turned up to full!!!

    Code::Blocks is an IDE (editor), NOT a compiler! Code::Blocks calls the compiler, and other external applications....
  9. @Deus_Venatus There are many problems with...

    @Deus_Venatus

    There are many problems with this code, It obviously cannot compile, or if it did, it did so with warnings turned off!



    int main(double a, double b, double c)

    //main is...
  10. Debian testing: gcc (Debian 9.2.1-8) 9.2.1...

    Debian testing:

    gcc (Debian 9.2.1-8) 9.2.1 20190909

    gcc --std=c18

    C18 is the ISO name for what some call C17.
  11. Replies
    3
    Views
    161

    You have to capture the return value from rand(),...

    You have to capture the return value from rand(), and keep count of how many values captured from rand(), in the while loop, then after the loop, divide the total by the count to get the average.
    ...
  12. Replies
    5
    Views
    202

    Two other problems in addition to @jimblumberg's...

    Two other problems in addition to @jimblumberg's comments.

    fflush(stdin) should NEVER be used! fflush() is for output file only! fflush(stdin) is a perfect example of Undefined Behavior!

    Your...
  13. Replies
    12
    Views
    193

    It is not necessarily DDoS. There are many...

    It is not necessarily DDoS. There are many reasons the site is not responsive. I suspect they are working on whatever the issue is.

    DDoS is probably at the very bottom of the list of...
  14. Replies
    11
    Views
    181

    Please show the specific scanf() call, that shows...

    Please show the specific scanf() call, that shows the use of these chars, and we can explain.
  15. Replies
    2
    Views
    153

    You are doing assignments not tests for...

    You are doing assignments not tests for equivalencies! '==', NOT '='!

    Also, you fail to test if the scanf() calls were successful! What if I typed "abc" in response to one of the prompts?
  16. Replies
    7
    Views
    187

    Then you will need to use conio.h for this...

    Then you will need to use conio.h for this course, or at least, this assignment. However, after the course, I would strongly recommend to not use it in the future.

    I would be happy to discuss...
  17. Replies
    7
    Views
    187

    Please post all cde in blocks, as instructed...

    Please post all cde in
    blocks, as instructed in the FAQ's.
    [CODE]#include<stdio.h>
    #include<conio.h>
    int num,repeat;
    main()
    {
    printf("Enter any number: ");
    scanf("%d", &num);
    ...
  18. Replies
    7
    Views
    187

    We don't program your project. You need to show...

    We don't program your project. You need to show us your attempt at writing the code, then we can comment on your attempt.

    Please also read the FAQs at the top of the forum.
  19. Replies
    14
    Views
    365

    Move the srand() function call to main, and ONLY...

    Move the srand() function call to main, and ONLY call it once. That will eliminate the problem with the same number being generated by rand().
  20. Replies
    7
    Views
    257

    fgets() inputs the entire line, including the...

    fgets() inputs the entire line, including the trailing newline char.

    After using the fgets(), you need to remove the newline char. You can use the following code:

    char *p = NULL;
    if ((p =...
  21. Replies
    5
    Views
    141

    @bab27 I would use fgets() to input the string...

    @bab27

    I would use fgets() to input the string rather than use scanf() as scanf() as written inputs a word not a string.

    fgets() does input the newline at the end of the string input. You...
  22. Replies
    10
    Views
    171

    An array name is not a normal variable. The...

    An array name is not a normal variable. The array name is resolved by the compiler at compile time as the address of the first element of the array. So the array name by itself IS a "char *".
    ...
  23. Thread: File problem

    by rstanley
    Replies
    26
    Views
    368

    The man...

    The man command, is the command line or online manual for the C Programming Language, Linux commands, and other topics. It will describe the various functions, operators, and other information.
    ...
  24. Replies
    10
    Views
    171

    A String literal in double quotes, DOES contain a...

    A String literal in double quotes, DOES contain a '\0' at the end so you do not have to add one.

    You need to study a good book on the C Language. This would explain this and other concepts a C...
  25. Replies
    10
    Views
    171

    Worse! You can't write to the constant empty...

    Worse! You can't write to the constant empty string pszMessage is pointing to!



    void printError(pLSenv pEnv, char* origin, int nErrorCode) {
    char pszMessage[512] = "";

    int nn =...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4