목록BCA/10. 모던 C++ 입문 (2)
VioletaBabel
2. 클래스
클래스는 데이터(멤버 변수), 함수(메서드, 멤버 함수), 타입 정의, 포함된 다른 클래스 등을 가질 수 있다. 1. friend12345678910111213141516171819202122232425262728293031323334353637#includeusing namespace std; class one{public: one() { num = 100; } friend class two; void showNum() { cout
BCA/10. 모던 C++ 입문
2018. 12. 28. 12:44
1. 변수기본 타입은 내장 타입(Intrinsic Type)이라고 한다. 12345678910111213#includeusing namespace std;int main(){ int i1 = 2; // i1 = 2 int i2, i3 = 5; // i2는 초기화 되지 않음, i3 = 5 float pi = 3.14159; // pi = 3.14159 double x = -1.5e6; // x = -1.5e+06 = -1500000 double y = -1.5e-6; // y = -1.5e-06 = -0.0000015 char c1 = 'a', c2 = 35; // c1 = a, c2 = # bool cmp = i1
BCA/10. 모던 C++ 입문
2018. 12. 27. 12:31