onlinegdb 사용함.


/******************************************************************************


Welcome to GDB Online.

GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,

C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.

Code, Compile, Run and Debug online from anywhere in world.


*******************************************************************************/

#include <iostream>

#include <vector>

using namespace std;


class P {

public:

    int a;

    int b;

};


void f(P p1)

{

    cout << p1.a << " " << p1.b << endl;

}


int main()

{

    P p1;

    p1.a = 10;

    p1.b = 50;

    f(p1);    // 여기서 p1.a, p1.b를 복사해서 f로 넘겨준다는거지?


    return 0;

}