2008. 5. 1. 20:51
@GSMC/서용덕: DMD Programming
by 서 교수님
int *arr;
arr = new int[N]; //C++
arr = (int *) malloc(sizeof(int)*N); //C
"realloc"
int *A;
int len = 3;
int *append (int *A, int lA, int lB)
{
int *B = new int[5];
for (i=0; i<3; i++)
{
B[i] = A[i];
delete [] A;
}
return B;
}
A = append (A, 3, 5);
int len = 3;
int *append (int *A, int lA, int lB)
{
int *B = new int[5];
for (i=0; i<3; i++)
{
B[i] = A[i];
delete [] A;
}
return B;
}
A = append (A, 3, 5);
'@GSMC > 서용덕: DMD Programming' 카테고리의 다른 글
data type 정리 (0) | 2008.05.24 |
---|---|
[Steve Oualline] 11. Bit Operations (0) | 2008.05.14 |
[Steve Oualline] 10. C Preprocessor (0) | 2008.04.22 |
hw 6 - 9장 연습문제 3번 (0) | 2008.04.17 |
[Steve Oualline] 9. Variable Scope and Functions (0) | 2008.04.16 |