相关疑难解决方法(0)

在指针声明中放置星号

我最近决定我必须最终学习C/C++,有一件事我不太了解指针,或者更确切地说,他们的定义.

这些例子怎么样:

  1. int* test;
  2. int *test;
  3. int * test;
  4. int* test,test2;
  5. int *test,test2;
  6. int * test,test2;

现在,根据我的理解,前三个案例都是相同的:测试不是一个int,而是一个指针.

第二组示例有点棘手.在case 4中,test和test2都是指向int的指针,而在case 5中,只有test是指针,而test2是"real"int.案例6怎么样?案例5相同?

c c++ pointers declaration

86
推荐指数
8
解决办法
3万
查看次数

标签 统计

c ×1

c++ ×1

declaration ×1

pointers ×1