Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    133

    I'm wondering if he was supposed to use the...

    I'm wondering if he was supposed to use the "boardGame" class in making the new class. I don't think inheritance would be correct, but maybe something like:


    class tdBoard {
    boardGame bg[3];...
  2. Replies
    6
    Views
    84

    Yes, they are all the same. The point is that you...

    Yes, they are all the same. The point is that you can pass the exact same array to all of them. The last version is just explicitly saying what is actually happening. The other two are in a sense...
  3. Replies
    6
    Views
    84

    Do you understand that these all say essentially...

    Do you understand that these all say essentially the same thing?


    void f(char matrix3d [10][20][30]);
    void g(char matrix3d [ ][20][30]);
    void h(char (*matrix3d) [20][30]);

    When you...
  4. Replies
    6
    Views
    85

    head is a pointer variable that initially holds...

    head is a pointer variable that initially holds the address of the current first node, which will be NULL (basically zero) if the list is empty.

    The newly created node's next pointer is set to...
  5. Replies
    5
    Views
    129

    I think this is what you are trying to do. ...

    I think this is what you are trying to do.


    #include <stdio.h>
    #include <stdlib.h>
    #include <stdbool.h>
    #include <string.h>

    #define EXTEND_SIZE 256
  6. Replies
    5
    Views
    129

    If you're still having problems, post a complete...

    If you're still having problems, post a complete program that I can run.
    Also post the input.
  7. Replies
    10
    Views
    133

    This code is pretty senseless, actually. Why is...

    This code is pretty senseless, actually.
    Why is tdBoard derived from boardGame?
    It's not using any of it's functionality or data at all!
    You could delete 150+ lines and the program would be...
  8. Replies
    18
    Views
    270

    Oh, you're right. Except that the way we would...

    Oh, you're right. Except that the way we would usually handle it is by adding an extra space (just a space, not a newline) in front of the format of your other scanf.


    int len = 0;
    ...
  9. Replies
    18
    Views
    270

    You shouldn't have the newline character in that...

    You shouldn't have the newline character in that scanf format. It should just be:


    scanf("%d", &len);
  10. Replies
    2
    Views
    69

    I'm not sure what you're getting at. Both of...

    I'm not sure what you're getting at. Both of those seems to "work".

    However, if you mean to only allow decimal input for the integer then it's better to use %d instead of %i since %i accepts...
  11. Replies
    14
    Views
    268

    Thanks man. You didn't do anything wrong at all....

    Thanks man. You didn't do anything wrong at all. (I really was cranky, complete with headache!)
  12. Replies
    14
    Views
    268

    The basic meaning of + is not an overload and...

    The basic meaning of + is not an overload and they are definitely intrinsic to the compiler. They are pretty much just single assembly code instructions since the basic types correspond generally to...
  13. Replies
    2
    Views
    72

    This works for me (in C++14 so that the binary...

    This works for me (in C++14 so that the binary literals are legal) :


    #include <iostream>
    #include <bitset>


    using State = std::bitset<4>;

    struct Person {
  14. Replies
    4
    Views
    100

    @Zeus, perhaps if you don't know anything about a...

    @Zeus, perhaps if you don't know anything about a topic you can just shut the f up? He can use google himself.

    At any rate, in C "generic data structure" can mean a couple of different things. It...
  15. Replies
    9
    Views
    140

    It is a case of underflow. With unsigned values...

    It is a case of underflow. With unsigned values underflow and overflow are well-defined. With signed values they aren't. Underflow is like turning an odometer backwards from 0, except in binary. So...
  16. Replies
    2
    Views
    66

    It looks like you are missing this: ...

    It looks like you are missing this:


    prevDate->next_date->next_date = NULL;


    BTW, don't do this:


    if (prevDate->next_date == NULL) {
  17. Replies
    12
    Views
    147

    @laserlight, I checked it and it compiles just...

    @laserlight, I checked it and it compiles just fine.
    And moving the inline keyword to the original position causes an error.
  18. Replies
    1
    Views
    172

    When you look at the errors that the compiler...

    When you look at the errors that the compiler spits out, always scroll back to the very first one and deal with that one first. The first error your compiler should mention is that in the function...
  19. Replies
    12
    Views
    147

    I used my googlefu and typed in "programming...

    I used my googlefu and typed in "programming library measurement error".


    That's definitely a laserlight question (she's a C++ expert). However, what you have looks pretty good to me, with the +=...
  20. Replies
    12
    Views
    147

    Perchance List of uncertainty propagation...

    Perchance List of uncertainty propagation software - Wikipedia
  21. Replies
    4
    Views
    97

    You dereference the pointer before you check if...

    You dereference the pointer before you check if it's null.

    BTW, don't put "void" in the parameters when a function takes nothing. Just leave the parentheses empty. In old C you had to do that,...
  22. Replies
    13
    Views
    193

    The only "edge case" I can conceive is if the...

    The only "edge case" I can conceive is if the queue is empty, but you handle that as per instructions (returning 0). Can you contact another student and ask if they are having trouble? Maybe the test...
  23. Replies
    13
    Views
    193

    I don't see anything wrong. :confused: BTW,...

    I don't see anything wrong. :confused:

    BTW, we usually don't cast the return value of malloc (if your compiler complains then it's set for compiling C++, not C).
  24. Replies
    13
    Views
    193

    Firstly, always post real code (this code is not...

    Firstly, always post real code (this code is not real since newQueue doesn't even return the queue, which your compiler should've warned you about).

    Secondly, always post a complete program (and...
  25. Replies
    18
    Views
    270

    Not necessarily. It depends on the format spec....

    Not necessarily. It depends on the format spec. %d simply stops when it encounters a non-digit (which may or may not be a space).
    %s reads only up to the first whitespace, but %[^\n], for example,...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4