Technote87 [C++] 구조체 #include using std::cout; using std::endl; struct Account { char accID[20]; char secID[20]; char name[20]; int balance; }; int main(void) { Account yoon={"1234","2321","yoon",1000}; cout 2009. 9. 17. [C++] 동적 메모리 할당에서 메모리 관리 #include #define DEBUG 1 //#define DEBUG 0 using std::cin; using std::cout; using std::endl; int main(void) { int size; cout size; int* arr=new int[size]; #if DEBUG==1 cout 2009. 9. 17. [C++] Null 포인터를 리턴하는 new 연산자 #include using std::cin; using std::cout; using std::endl; int main(void) { int size; cout > size; int* arr=new int[size]; if(arr==NULL) { cout 2009. 9. 17. [C++] Null 포인터를 리턴하는 new 연산자 #include using std::cin; using std::cout; using std::endl; int main(void) { int size; cout size; int * arr = (int*)malloc(sizeof(int)*size); for(int i = 0 ; i < n ; i ++) arr[i] = i+!0; for(int j = 0 ; j < size; j++){ cout 2009. 9. 17. 이전 1 2 3 4 5 6 7 8 ··· 22 다음