Search:

Type: Posts; User: Chris L. Tailor

Search: Search took 0.01 seconds.

  1. Replies
    41
    Views
    2,760

    Ok, I did not understand it. The function,...

    Ok, I did not understand it.

    The function, which returns a stellarobject& is only really needed when you want that ++(++obj) returns a 2, that's the case which Elysia described, right?
    ...
  2. Replies
    41
    Views
    2,760

    Well, I understand the implementation, I just...

    Well, I understand the implementation, I just wonder why this

    void increment(){ id++; }


    and, for instance, this



    stellarobject operator++(){
  3. Replies
    41
    Views
    2,760

    So to put it all in a nutshell: In the average...

    So to put it all in a nutshell:

    In the average case id++ is equal to id = id+1

    Inside the operation overload function a++ means something totally different,




    stellarobject operator++(){
  4. Replies
    41
    Views
    2,760

    Ah now I see, without the & it just returns twice...

    Ah now I see, without the & it just returns twice a copy of stellarobject incremented by one, while the other one with the & updates itself twice and gets the 2.

    There's just one thing that ...
  5. Replies
    41
    Views
    2,760

    Ah, I think I understand now, but even when I...

    Ah, I think I understand now, but even when I leave out the & after stellarobject the method increments the stellarobject, so in this case, it doesn't make a difference?
  6. Replies
    41
    Views
    2,760

    I think, I should precise my question: I know...

    I think, I should precise my question:

    I know what a reference is, but (I know what &stellarobject means) stellarobject& , why can you write it after the data type?

    And &stellarobject and...
  7. Replies
    41
    Views
    2,760

    I have a another question, is there a difference...

    I have a another question, is there a difference between


    stellarobjekt operator++(){ //Durch das braucht man keine Temporärvariable, sondern weist die Änderung direkt dem betreffenden ...
  8. Replies
    41
    Views
    2,760

    I am using MinGW 4.7.2.

    I am using MinGW 4.7.2.
  9. Replies
    41
    Views
    2,760

    So I tried it out with the Cygwin Compiler and...

    So I tried it out with the Cygwin Compiler and everything works fine. In conclusion, it is an issue with MinGW.
  10. Replies
    41
    Views
    2,760

    The problem isn't just the syntax highlighting,...

    The problem isn't just the syntax highlighting, the compiler doesn't seem to understand operator+, it thinks of it as a normal method I think.

    There are no errors, the programm just gives out the...
  11. Replies
    41
    Views
    2,760

    That feeling when operator overloading is broken...

    That feeling when operator overloading is broken in mingw/g++...
  12. Replies
    41
    Views
    2,760

    Thank you all for the many responses. Well, the...

    Thank you all for the many responses.
    Well, the author used that C/C++ hybrid style, no idea why he did it, but I'll stick to C++ from now on.

    Got another issue regarding overloading operators,...
  13. Replies
    41
    Views
    2,760

    I think I understand now, in your second example,...

    I think I understand now, in your second example, the pointer is not updated, because you just change the value of the local pointer, by giving it the value of the x, but it doesn't affect the...
  14. Replies
    41
    Views
    2,760

    So you are saying that void main{ int...

    So you are saying that


    void main{
    int *pointer = NULL;

    function (&pointer);
    return 0;
    }
  15. Replies
    41
    Views
    2,760

    If I leave out the & when transfering pstart and...

    If I leave out the & when transfering pstart and leaving out one *, I am basically just sending the adress, I thought?

    The adress is all it needs to update itself with pliste? The IDE also gives...
  16. Replies
    41
    Views
    2,760

    Question regarding pointers

    Hey guys,

    I have programmed a tree structure with the help of my C++ book and was wondering about the usage of double pointers by the author.

    Here's the code:




    #include <iostream>
Results 1 to 16 of 16