Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.10 seconds; generated 38 minute(s) ago.

  1. It's the same in C++. You can easily demonstrate...

    It's the same in C++. You can easily demonstrate this by changing the forward declaration to have an fstream first parameter instead.

    As I said, the issue is that you didn't define the function...
  2. It's a link error stating that you didn't define...

    It's a link error stating that you didn't define the function named generate which has a first parameter of type std::ifstream&, which is true because you defined an overloaded function named...
  3. Replies
    4
    Views
    90

    You had the good idea of drawing a truth table,...

    You had the good idea of drawing a truth table, so let's do that:

    X Y Z
    0 0 0
    0 1 1
    1 0 1
    1 1 1
    This is the exact truth table you drew in post #1, and indeed it corresponds to what you...
  4. Replies
    4
    Views
    90

    So what's the point of R3? And what does this...

    So what's the point of R3? And what does this have to do with x, y and z?
  5. Replies
    3
    Views
    152

    What are the compile errors and what do you think...

    What are the compile errors and what do you think they mean?

    By the way, I'd get rid of IsFull: it is fairly useless as far as normal usage will go: your linked list grows dynamically, so it...
  6. Replies
    49
    Views
    907

    The idea is that if you have a list of 49...

    The idea is that if you have a list of 49 numbers, to select the first 6 numbers at random without replacement, you do a partial shuffle such that the first 6 numbers out of the 49 are done with the...
  7. Replies
    1
    Views
    88

    Use a debugger to set breakpoints and step...

    Use a debugger to set breakpoints and step through your code. From there, you will be able to narrow down where the infinite loop is happening, and hopefully that will be enough insight for you to...
  8. What's your best try?

    What's your best try?
  9. Replies
    1
    Views
    90

    This is not a way to access the members, but to...

    This is not a way to access the members, but to initialise them by name.
  10. Replies
    4
    Views
    134

    You would do something like what the printf...

    You would do something like what the printf family of functions does: have a known parameter that describes the types of the variable arguments. In the case of printf, it is a format string with...
  11. Replies
    1
    Views
    98

    In this context, i.e., when they are used...

    In this context, i.e., when they are used standalone, there is effectively no difference. The differences only matter when they are used as part of a larger expression.
  12. Replies
    4
    Views
    172

    It stores the address of the structure object. ...

    It stores the address of the structure object.

    This address is the same in value as one of the members of the struct object (i.e., the first) because the struct object consists of these members,...
  13. Replies
    6
    Views
    131

    "excess elements in array initializer" sounds...

    "excess elements in array initializer" sounds pretty straightforward: you're trying to initialise the array with too many elements. For example, in this case you declared the array as an...
  14. Replies
    8
    Views
    404

    Search the Web for a JSON parser for C++

    Search the Web for a JSON parser for C++
  15. Almost. To be consistent, the last printf should...

    Almost. To be consistent, the last printf should be:

    printf(" n = %p \n", n);
    Also, technically the argument corresponding to %p should be a void*, so you may see:

    printf(" n = %p \n",...
  16. Look at this example that you yourself wrote: ...

    Look at this example that you yourself wrote:

    int fun ( int *p )
    {
    *p = 20;

    return p;
    }
    Here is the same function, but with the place in the syntax where the return type is...
  17. Check the return type of the function. Is it a...

    Check the return type of the function. Is it a pointer type? If yes, then the function returns a pointer.
  18. Replies
    6
    Views
    152

    At the top of foo.c, declare x: extern int x;...

    At the top of foo.c, declare x:

    extern int x;

    You also need to #include <stdio.h> in foo.c
  19. Only mathematically. In this context, 20 is an...

    Only mathematically. In this context, 20 is an int, whereas 0061FF28 is an address (i.e., the value of a pointer). The function is declared as returning an int, not a pointer.


    Since you want to...
  20. Replies
    6
    Views
    152

    Yes, a global variable indeed has global scope,...

    Yes, a global variable indeed has global scope, i.e., every use of that name that has not been shadowed by another variable whose name has a more local scope refers to that global variable.
  21. Replies
    4
    Views
    142

    "Hello" is a string constant because it is a...

    "Hello" is a string constant because it is a string constant by definition. Likewise, in this program below, 123 is an integer constant because it is an integer constant by definition, no const...
  22. Replies
    4
    Views
    142

    "Hello" is a string constant, so it exists...

    "Hello" is a string constant, so it exists independently of the pointer.
  23. Replies
    5
    Views
    291

    The simple answer is that you're looking at the...

    The simple answer is that you're looking at the effects of undefined behaviour because accessing an array out of bounds is undefined behaviour. Going deeper, it could be that you were modifying other...
  24. Replies
    2
    Views
    91

    You need to call the function through the...

    You need to call the function through the function pointer:

    (*execute)();
    It should also be possible to omit the explicit dereference as a form of syntactic sugar:

    execute();
  25. Replies
    5
    Views
    291

    Your idea of creating a new dynamic array and...

    Your idea of creating a new dynamic array and copying over the old one to it each time you add a grade is rather expensive: instead of taking amortised constant time, addGrade will take linear time,...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4