【问题标题】:Data type of an address to a pointer to a const char指向 const char 的指针的地址的数据类型
【发布时间】:2020-03-20 17:02:48
【问题描述】:

我有一个非常简单的问题:

const char *y = "string_test";
x = &y;

x 是什么类型?

提前感谢您的回答!

【问题讨论】:

  • y是什么类型?
  • 我认为这是一个错字。你的意思是写'q'而不是'y'?

标签: c pointers types


【解决方案1】:

假设您的问题中有错字,代码是:

const char *y = "string_test";
x = &y;

x 应定义为:

const char** x; // x is a pointer(Address of) a pointer to a constant char/string

【讨论】:

  • 我就是这么想的。非常感谢您的帮助
猜你喜欢
  • 1970-01-01
  • 2023-03-08
  • 1970-01-01
  • 1970-01-01
  • 2020-07-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多