Search:

Type: Posts; User: std10093

Search: Search took 0.02 seconds.

  1. Replies
    9
    Views
    1,195

    Oh Elysia is correct. How in the world did I miss...

    Oh Elysia is correct. How in the world did I miss that? Sorry.

    If you run this code, you will see what Elysia says:


    A& f(A& x)
    {
    return x;
    }
  2. Replies
    9
    Views
    1,195

    If I understand correct, you mean this: int...

    If I understand correct, you mean this:


    int main()
    {
    A a;
    A c;
    c = a;
    return 0;
    }
  3. Replies
    9
    Views
    1,195

    But, imagine that when the function gets called,...

    But, imagine that when the function gets called, the object comes from main and gets assigned to the argument of the function, thus we can imagine it as an assignment in that case, which of course...
  4. Replies
    9
    Views
    1,195

    You did that: A b= f(a); So, when f(a)...

    You did that:


    A b= f(a);

    So, when f(a) was called, what happened to a? Moreover, look at the definition of the function named "f()". The argument is neither a reference nor a pointer. So, we...
  5. Replies
    9
    Views
    1,195

    Run the code with this function: (notice the ref)...

    Run the code with this function: (notice the ref)


    A f(A& x)
    {
    return x;
    }


    Can you tell the difference? :)
Results 1 to 5 of 5