我有一个代码片段很难理解。
char *c; // c is uni dimensional table ( single row )
char **p ; // p is a two dimensional table
**p = *c; // what does this mean ?
当我执行上述作业时, c 是否被复制为 p 的第一行?
或者 c 被复制为 p 的第一列?
最佳答案
**p = *c; // what does this mean ?
When I do the above the assignment , Is the c copied as first row of p ? or c is copied as first column of p ?
也不是,该代码将 c
的第一个元素复制到 p
的第一个元素。相当于
p[0][0] = c[0];
关于c pointer assignment to pointer to pointer 是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7543547/