howdy,
im learning pointer and memory management from a book. ive been playing with this C++ stuff for a few months now but when i start reading and typing the sample code for the pointers i can not get a handle on what is going on. for example:
~~~~~~~~~~~code~~~~~~~~~~~~~~~
#include <iostream.h>
#include <iomanip.h>
int main()
{
int stuff[3][4] = {{11, 22, 45, 23},
{33, 67, 28, 45},
{98, 4, 71, 90}};
int *ip;
int(*ip4)[4]; //WHAT IS THIS FOR?
int i, j;
ip4 = stuff;
ip =(int *) stuff; //POINTER NOT TO AN ARRAY??
cout<<"Storage of date: "<<endl'
for(i=0;i<4; i++)
cout<<ip[i];
cout<<endl;
cout<"Matrix concept: "<<endl;
for(i=0; i<3; i++)
{
for(j=0; j<4; j++)
{
cout<<*(*(ip4 =i) + j)<<" "; //WHAT IS THIS DOING
}
cout<<endl;
}
getchar(); //freezes the screen
return 0;
}
~~~~~~~~~~~~~code~~~~~~~~~~~~~~~~~
sorry about the format i couldnt figure out how to put @#&%$ code tags on this thing.
thanks
M.R.



LinkBack URL
About LinkBacks
sorry about the format i couldnt figure out how to put @#&%$ code tags on this thing.




.