C指针与指针指针-正确的用法是什么? [英] C pointer vs pointer to pointer - what's the proper usage?

查看:80
本文介绍了C指针与指针指针-正确的用法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

指针和双指针有什么区别

为什么要使用第二个?

char *a; //Points to a char
char **b; //Why doesn't this also point char

解决方案

双指针"只是指向另一个指针的指针.在您的示例中,指向该字符的指针的指针.

编辑 实际上,这是在此处回答的.. >

What is the difference between a pointer and a double pointer

Why would the second one ever be used?

char *a; //Points to a char
char **b; //Why doesn't this also point char

解决方案

A "double pointer" is just a pointer to another pointer. In your example, a pointer that points to a pointer that points to a char.

EDIT Actually this was answered here.

这篇关于C指针与指针指针-正确的用法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆