Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

two dimensional dynamic array c++

int ** two_dim_array(int row_num, int col_num)
{
	int **two_dim_array=(int **)malloc(sizeof(int *)*row_num);
    int i, j;
  	for(i=0:i<row_num;i++)
    {
  		two_dim_array[i]=(int *)malloc(sizeof(int)*col_num);
      	for(j=0:j<col_num;j++)
          	two_dim_array[i][j]=0;
    }
  	return two_dim_array;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dimensional #dynamic #array
ADD COMMENT
Topic
Name
2+5 =