Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

How to make an array dynamically using pointers

#include<iostream>
using namespace std;

int main() {
   int rows = 3, cols = 4;
   int** arr = new int*[rows];
   for(int i = 0; i < rows; ++i)
   arr[i] = new int[cols];
   return 0;
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #How #array #dynamically #pointers
ADD COMMENT
Topic
Name
2+2 =