2d array ,,this code works welll for 5,5 but fails for 6,6 can me in debugging it
hey @manish.bharadwajsbh send me your this code using ide.codingblocks.com, i will see and let you know what mistake is it.
If you don’t know how to share you can ask me that too.
im enclosing code here too
#include
using namespace std;
int main(){
int r=0,row,col,val=1;
cin>>row>>col;
int array[row][col];
for(r;r<=row-1;r++){
int c=0;
for(c=0;c<=col-1;c++){
array[row][col]= val;
val++;
cout<<array[row][col]<<" " ;
}
cout<<endl;
}
}
It works perfectly fine, what issues are you getting in this?
You can use " \t" if you want organized formatting like i have done in this code
plz check the original pic enclosed
are you talking about this test case?
yes yes yes
yes yes yes
Might be an issue with sublime text cause the same code works fine on online ide.
oh okay now that we are here is there any way i could see my code run line by line so that it can help me in debugging.
You are already doing that, in your 2 for loops in every iteration you are printing some element. Which means that if matrix size is 5x6 then the last element it should print is 30 whereas for 6x6 it should be 36. So you are doing that only, checking after each iteration what my code is printing
no no im asking is there any software or extension where i can see my code getting executive line by line
Unfortunately there isn’t any. Or in my domain i don’t think so there is. Though you can dry run it always to check what is it actually doing.
can u help with this??please
You can re install sublime, or you can work with online ide’s too. If you want me to send some video for the same then i can do that.