Search
 
SCRIPT & CODE EXAMPLE
 

CPP

loop over multidimensional array c++

int arr[2][3] = {
  {1,2,3}, 
  {4,5,6}
};
for(int i=0 ; i<sizeof(arr) / sizeof(arr[0]) ; i++){
	for(int j=0 ; j<sizeof(arr[i])/sizeof(arr[i][0]) ; j++){
		cout<<"2D array have: "<< arr[i][j]<<endl;
	}
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to include everything in c++ 
Cpp :: isprime c++ 
Cpp :: unistall lutris 
Cpp :: c++ alphabet array 
Cpp :: c++ get files in directory 
Cpp :: c++ message box error 
Cpp :: tribonacci series c++ 
Cpp :: c++ reverse vector 
Cpp :: c++ print colorful 
Cpp :: c++ pause program 
Cpp :: Count set bits in an integer c++ 
Cpp :: c++ text formatting 
Cpp :: print data type of a variable in c++ 
Cpp :: sony pictures animation films produced 
Cpp :: qt rotate qimage 
Cpp :: constant pointer c++ 
Cpp :: how to calculate polar coordinates in c++ 
Cpp :: 3d array in c++ 
Cpp :: matrix layout in C++ 
Cpp :: google test assert eq float 
Cpp :: access last element in vector in c++ 
Cpp :: distinct colors cses solution 
Cpp :: how to get a word from file c++ 
Cpp :: cpp random number in range 
Cpp :: c++ loop pyramid 
Cpp :: c++ loop through array 
Cpp :: arduino notone 
Cpp :: C++ generate a random letter 
Cpp :: how to iterater map of sets in c++ 
Cpp :: round double to n decimal places c++ 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =