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 -05:00

回到话题: An interesting question.

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=25669