Search:

Type: Posts; User: xeddiex

Page 1 of 6 1 2 3 4

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

  1. Replies
    3
    Views
    1,118

    If you just want to return a char, then just...

    If you just want to return a char, then just return a char and not a pointer to a char.

    Rewrite your return as: char operator + (blah.. blah.. blah..);
    else, what you're doing when you apply the...
  2. Replies
    1
    Views
    1,148

    rvalues and member functions

    If the following returns a temporary and you call a member function on it that modifies member data, why is it legal when the temporary is an rvalue? Remember, temporaries can't be bound to non-const...
  3. Replies
    14
    Views
    4,225

    First, I went off on vacation and totally forgot...

    First, I went off on vacation and totally forgot to reply to this post before leaving. So sorry.

    From the boldfaced quote above, you're telling me that a reference can be bound directly to the...
  4. Thread: Overrriding

    by xeddiex
    Replies
    3
    Views
    1,544

    This stuff can be very confusing to beginners...

    This stuff can be very confusing to beginners learning polymorphism...
    Here's a basic low-down of your code:

    Each class can represent an object. In class C when you invoke bmet();, your code...
  5. Replies
    14
    Views
    4,225

    Mario, I have a question about the above...

    Mario, I have a question about the above boldfaced paragraph: operator -, returns by value as we all know, but, after the return statement, a unnamed temporary is created W/the value of the return...
  6. Replies
    14
    Views
    4,225

    He also has a syntax error on this line: return...

    He also has a syntax error on this line:
    return body.v + Vector::cross(body.omega, p - body.x));

    - xeddiex
  7. Replies
    14
    Views
    4,225

    You haven't defined operator + - xeddiex

    You haven't defined operator +

    - xeddiex
  8. Thread: What next?

    by xeddiex
    Replies
    7
    Views
    1,001

    What did you learn C++ for? What was your intent...

    What did you learn C++ for? What was your intent for learning it? Personally, I think it's time to get serious with the language and learn way more about it. The basics aren't going to cut it if you...
  9. Replies
    6
    Views
    3,079

    A static variable is created once during a...

    A static variable is created once during a programs lifetime and last until the program is terminated. Are you using the non-static LOGFONT variable outside your WM_CREATE handler?
  10. Thread: Link List

    by xeddiex
    Replies
    59
    Views
    4,836

    Sorry about posting that bad code then :). Given...

    Sorry about posting that bad code then :). Given your exercise, how would I go about reversing the order with only being able to move the top book? I can think of a couple of ways but, I don't think...
  11. Replies
    26
    Views
    3,129

    integers can be represented as characters, by...

    integers can be represented as characters, by interpreting them with their equivelant ascii value; http://www.lookuptables.com/
  12. Replies
    26
    Views
    3,129

    You don't even need a switch for that. It can be...

    You don't even need a switch for that. It can be accomplished in a simple pair of if statements:



    if ( numberhold >= 'A' && numberhold <= 'Z' )
    std::cout<<"uppercase character is...
  13. Thread: Link List

    by xeddiex
    Replies
    59
    Views
    4,836

    The way I created my generic, Linked List, class...

    The way I created my generic, Linked List, class was w/an inner defined structure (chosen simply because it's public by default) that the outer class would instantiate an instance of and, therefore,...
  14. Replies
    7
    Views
    1,576

    Weather he uses the rcPaint member or the actual...

    Weather he uses the rcPaint member or the actual arbitrary region doesn't really matter because, windows will prevent you from painting outside the invalid region anyway.

    To to OP: The window will...
  15. Replies
    3
    Views
    858

    You don't need the dereference operator on each...

    You don't need the dereference operator on each element. Remove them.
  16. Replies
    6
    Views
    6,098

    void somefunc(PS ps) { S s = *ps; } ...

    void somefunc(PS ps)
    {
    S s = *ps;
    }

    The contents of *ps are copied by value into s
  17. Replies
    5
    Views
    4,861

    just save every source file you create with the...

    just save every source file you create with the .c extension and everything will work fine.
  18. Thread: malloc

    by xeddiex
    Replies
    2
    Views
    1,359

    int x; x = 5; the pointer equivelance: int...

    int x;
    x = 5;

    the pointer equivelance:
    int *p = malloc(sizeof(int));
    *x = 5;

    if you did:
    x = 5;
  19. Replies
    4
    Views
    2,391

    And I applaud you for that. Many people recommend...

    And I applaud you for that. Many people recommend learners use a feature already provided in the language but, I think that is a bad idea most of the time. The more things you do on your own, the...
  20. Wrap it around a structure and have a void*...

    Wrap it around a structure and have a void* pointer to whatever data you will need in the calling function along with the dimensions of the data, inside the strucure.

    Example:



    struct...
  21. Replies
    8
    Views
    1,272

    I personally recommend Visual C++ 2005 Express...

    I personally recommend Visual C++ 2005 Express Edition . It's free also ;), Just don't forget to create your source files with the .c extension or they'll default to .cpp (c++).
  22. Thread: Read line

    by xeddiex
    Replies
    6
    Views
    1,454

    You could parse the returned string and seperate...

    You could parse the returned string and seperate the words or, you could use fgetc to return one byte at a time and do a constant check for ' ' (space) to denote the end and begining of a word.
  23. Replies
    4
    Views
    7,346

    There a couple of ways. One is with a pointer to...

    There a couple of ways. One is with a pointer to a pointer to objects and use it as an array.

    Example:


    PersonInfo** RetrieveArrayOfObjectsViaPtrToPtr(void);

    int main(int argc, char **argv)...
  24. Replies
    7
    Views
    2,037

    As Salem said, there's no reason to return the...

    As Salem said, there's no reason to return the array in your example. But, if you would still like to know how, then make the return function definition: int* and, make the return statement without...
  25. Replies
    4
    Views
    1,148

    The reason is because once function f() returns...

    The reason is because once function f() returns in the first printf, the x variable contains a new value, because it was modified in f(), x on return contains 5. When the second printf executes, it...
Results 1 to 25 of 135
Page 1 of 6 1 2 3 4