Hi,
In the following code, can someone tell me the difference between *p++ and
p++ ? I can see both achieve the same result.
Thanks a lot !
#include <iostream>
using namespace::std;
int main() {
char *p = "test pointer";
while (*p) {
cout << *p;
*p++; // <<- What is the difference between *p++ and p++ (both achieve
the same result) ?
}
cout << endl;
return 0;
}
In the following code, can someone tell me the difference between *p++ and
p++ ? I can see both achieve the same result.
Thanks a lot !
#include <iostream>
using namespace::std;
int main() {
char *p = "test pointer";
while (*p) {
cout << *p;
*p++; // <<- What is the difference between *p++ and p++ (both achieve
the same result) ?
}
cout << endl;
return 0;
}
Comment