PrintInfo(2)
-
[C++] 특정한 값을 출력하는 구조체를 만들어보자
1. #include #include using namespace std; // 구조체 변수 선언 struct Monster { string name; int lv; int hp; int damage; }; struct Computer { string name; int price; }; // 구조체의 멤버변수들을 출력하는 함수 void PrintInfo(Monster target) { cout
2022.06.02 -
[C++] 19. 멤버함수
#include #include using namespace std; struct Student { string name; int age; int id; // 멤버함수 // 별도의 매개변수가 필요없는데 내부에 변수가 선언되어있기 때문 // Student는 속성과 PrintInfo라는 기능이 있다. void PrintInfo() { cout
2022.06.02