달력

32024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

'동적할당'에 해당되는 글 1건

  1. 2011.06.20 포인터를 파라미터로 넘겨 동적할당


동적할당하는 함수 구현

** (x)
**& (o)
void alloc(int **&src,int w,int h);
void main(){
int **src;

alloc(src,w,h);
}


void alloc(int **&src,int w,int h){

int i,j;

src = new int*[h];

for(i=0;i<h;i++){

src[i] = new int[w];

}

}

Posted by sukay
|