×

Loading...

It is not a problem about programming style. I think it is better for you to know the difference. Please try:

old (HH)
int vals[200];
int * ptr;
::memset(vals, '\0', sizeof(int) * 200);
ptr = vals;
*ptr = 10;
cout << "before " << *ptr << endl;
*ptr++ = 20;
cout << "after " << *vals << " " << *ptr <<endl;

Then try:
int vals[200];
int * ptr;
::memset(vals, '\0', sizeof(int) * 200);
ptr = vals;
*ptr = 10;
cout << "before " << *ptr << endl;
*(ptr++) = 20;
cout << "after " << *vals << " " << *ptr <<endl;
(#25669@0)
2001-2-11 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: An interesting question.

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论