##
Re: How do we create N matrices simultaneously in C++?

You don't say of what type you want the matrices to be or whether n, k, n are constant known values at the time of compile or run-time parameters - which makes a big difference.

The simplest way to create a 3 dimensional matrix is

Code:

const int n = 10;
const int k = 5;
const int N = 15;
int matrix[n][k][N];

The element of this matrix can be accessed as eg

I would like to create N matrices of dimension (n,k) simultaneously.

However, do you actually mean that you want N matrices?

Code:

const int n = 10;
const int k = 5;
const int N = 15;
typedef int mat[n][k];
mat nkN[N];

here nkN is a matrix of dimension N of type mat which is a matrix of dimensions n, k.

What are you trying to do?

All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on.

C, C++ Compiler: Microsoft VS2015