c_cpp 在c中移动一个字节指针

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp 在c中移动一个字节指针相关的知识,希望对你有一定的参考价值。

#include <stdio.h>

//move byte pointer in c


void move_ptr(unsigned char** ptr)
{
  *ptr += 1;
}


int main(void) {
  unsigned char code[4] = {1, 2, 3, 4};
  unsigned char* cptr = code;
  move_ptr(&cptr);
  for(int i=0;i<4;i++) printf("%u\n", cptr[i]);
  return 0;
}

以上是关于c_cpp 在c中移动一个字节指针的主要内容,如果未能解决你的问题,请参考以下文章