본문 바로가기

반응형

Home

(200)
[C++]동적할당2 [[확인문제 1]] #include #include using std::cin; using std::cout; using std::endl; #define MEMO_CNT 5 #define MEMO_LENGTH 1024 int main() { char *p[MEMO_CNT]; char buf[MEMO_LENGTH]; char len[MEMO_LENGTH]; for(int i=0; i < MEMO_CNT; i++) { cout
[C++]포인터배열의 동적메모리할당 [[연습문제 1]] #include #include #include using std::cin; using std::cout; using std::endl; using std::setw; struct Student { char name[20]; int kor, eng, mat, sum; }; void input(Student *p, int in); void outpt(Student *p, int out); int main() { int in; cout > in; Student *pts; pts = new Student[in]; cout
[C++]동적할당 [[연습 1]] #include using namespace std; int main() { int stNum; cout > stNum; double *height; height = new double[stNum]; double sum = 0; for(int i=0; i < stNum; i++) { cout
[C++]레퍼런스 2 [[연습1]] #include using namespace std; void plunsTen(int *a, double *d); void plusTen(int &a, double &d); int main() { int a; double d; cout > a; cout > d; plunsTen(&a, &d); cout
[C++]레퍼런스(Refference) #include #include #include using namespace std; struct ACC { int accID; char pw[5]; char name[20]; int bal; }; void menu(int &sel); void mkacc(ACC &in); void save(ACC &in); void withdraw(ACC &in); void balance(ACC &in); int main() { ACC reval = {1111}; int choice; while(1) { menu(choice); switch(choice) { case 1: mkacc(reval); break; case 2: save(reval); break; case 3: withdraw(reval); break; ca..
[C++]함수오버로딩 & 디폴트파라메터 -2 문제 1 #include #include #include using namespace std; void user_rand(int st = 1, int ed = 100, int cnt = 10); int main() { srand(time(NULL)); user_rand(); int st, ed; cout > st >> ed; int cnt; cout > cnt; user_rand(st, ed, cnt); user_rand(st, ed); return 0; } void user_rand(int st, int ed, int cnt) { int i; cout
[C++]함수오버로딩 & 디폴트 파라메터 [[연습문제 1]] #include using namespace std; int square(int su); double square (double f); int main() { int su; cout > su; double f; cout > f; cout
[C++]자료의 입출력 #include #include #include using namespace std; void max(); void fact(); void mul(); int main() { int sel; while(1) { system("cls"); cout

반응형