The 2nd Monitor

General discussion about codereview.stackexchange.com - Welcom...
Dec 29, 2016 05:36
@Hosch250 I am a guy lol chill
Dec 29, 2016 05:34
I hope there are no feminists here haha
Dec 29, 2016 05:32
@Mast did you just assume I am a guy XD
Dec 29, 2016 05:21
(Y)
Dec 29, 2016 05:17
Thank you for that link. Yeah I thought about using vector but need to change code in several places. Anyway I will make it constant integer literal and test the code. Do you have any idea why it runs in C though?
Dec 29, 2016 05:12
How do I make it work I used to code this way in C and this doesn't work in C++ :(
Dec 29, 2016 05:05
@Hosch250 m and n are initialised during compilation that's not an issue. The code compiles fine in C. The error is the following "error: cannot initialize a parameter of type 'int ()[]' with an lvalue of type 'int (*)[n]"
Dec 29, 2016 04:57
bool dfsGrid(int m, int n, int a[][n]){

dfsGrid(m-1, n, a);

}

int main(){
int m= 10, n=10;
int a[m][n];
dfsGrid(m, n, a);
return 0;
}
Dec 29, 2016 04:57
Can someone tell me why this doesn't compile in C++ 11?
Dec 28, 2016 06:06
Congrats