class = 데이터 + 기능
데이터 : 멤버변수
기능 : 멤버함수
#include "FruitSeller.h"
#include "FruitBuyer.h"
int main(){
FruitBuyer buyer; //스택에 변수 선언
FruitSeller *seller = new FruitSeller; // 동적할당
}
buyer->BuyApples(seller, 5);
이 코드는 buyer객체가 "seller객체야, 사과 5개 살게" 라는 메세지를 seller객체에 보내는 거라고 본다.
Message Passing : 객체지향에서 객체가 다른객체에게 메세지를 전달하는 형태의 함수 호출