I am passing a two dimensional array to the mark function.
void mark(int n, int m, int i, int j, int canvisit[][m], int a[][m]){}
this code is working perfectly in C on Codeblocks but in C++, I am getting errors like :
prog.cpp:9:55: error: use of parameter outside function body before ']' token
void mark(int n, int m, int i, int j, int canvisit[][m], int a[][m]){
^
prog.cpp:9:56: error: expected ')' before ',' token
void mark(int n, int m, int i, int j, int canvisit[][m], int a[][m]){
^
prog.cpp:9:58: error: expected unqualified-id before 'int'
void mark(int n, int m, int i, int j, int canvisit[][m], int a[][m]){
Am I doing something wrong here? I am giving the number of columns before by int m
, and this is working in C but not C++. Any help will be highly appreciated.