++指针运算符

Nic*_*rin 2 c pointers increment

我的CS课程从Java到C有点转变。我现在正忙于遍历指针,并且我发现在递增引用时,用于递增的++运算符不起作用。这更是一个好奇心问题。只是现在还不习惯使用指针概念。我是在做错什么还是与指针有关?

例如:

*pointer++; Will not increment the value.
*pointer+=1; Will increment the value.
Run Code Online (Sandbox Code Playgroud)

提前致谢!

Sco*_*uer 5

当您想增加值时,必须确保使用括号。

(*pointer)++;
Run Code Online (Sandbox Code Playgroud)