c++里面的函数前面加上一个*号这个是什么意思的?

例如struct student *insert(struct student *head) 这个结构体的struct student *insert这个在insert前面加上*号和不加有啥区别吗?

这个*号不在和函数连在一起的,是函数返回值的一部分struct student *insert(struct student *head)这个函数的返回值就是,struct student *
温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-05-21
表示子程序返回来的是结构指针。在子程序中对head进行处理后,得到新的head,返回时用: return head;}
你可以把返回的head有赋个另一个struct student 定义的结构指针,如*p:
struct student *p;

p=insert( head);
应当很好理解。一般编程时,为了准确期间,都要传指针,特别是在嵌入式编程时。
第2个回答  2013-05-27
它返回的类型是指针型的
相似回答