Hello all and pointers to multi-dimensional arrays
First and foremost, Hi :)
I'm new here and since only recently I started to learn C++, I think I'll stick around :D
I've been following the excellent tutorial here ate cprogramming as part of my learning, changing a lot of code to better see if I really understood each subject. On one of those changes I got stalled.
Lesson 8 teaches arrays. Nothing wrong here, only when I was doing my own experiments, I applied what I had learned in lesson 6 - Pointers. Great lesson, btw! I finally was able to understand the buggers. Anyway... I tried to pass a pointer into a multidimesional array. Like this
Code:
char mycharr[8][8];
char *ptrarr;
ptrarr = mycharr;
And it didn't work. I get a compile error like this:
Code:
assignment to `char *' from `char (*)[8]'
It works fine for normal arrays, but I still couldn't figure it out how to use it on multi-dimensional ones even after messing with the above code.
I use mingW that comes with Blodsheed's Dev-C++ IDE. Don't ask me compiler versions... I'm not even near that stuff :D
Re: Hello all and pointers to multi-dimensional arrays
Quote:
[I tried to pass a pointer into a multidimesional array. Like this
Code:
char mycharr[8][8];
char *ptrarr;
ptrarr = mycharr;
I think /.....
Code:
char mycharr[8][8];
char *ptrarr;
ptrarr = mycharr; // here you need to overload " = "
Does it needs some overloading...?:confused:
Did it compile at the end....
Did it compile... at the end...