c——————指针之易错点
来源:互联网 发布:软件需求变更 编辑:程序博客网 时间:2024/06/10 14:48
指针变量在用之前要指出指向的对象列如
#include<iostream>#include<string>using namespace std;struct stu{ string name;//string sex;//string id;//float C[4];//stu * next;};int main(){struct stu * a;(*a).name="-";cout<<(*a).name;return 0;}
是错误的
正确的应该指明对象
#include<iostream>#include<string>using namespace std;struct stu{ string name;//string sex;//string id;//float C[4];//stu * next;};int main(){stu b;struct stu * a=&b;(*a).name="-";cout<<(*a).name;return 0;}
0 0
- c——————指针之易错点
- C——指针
- C++——指针
- C语言—指针
- c++—智能指针
- C语言提高之——C和指针总结
- C语言深度剖析之—指针与内存地址(函数指针,普通指针,指针数组,数组的指针,指针的指针)
- C语言深度剖析之—指针与内存地址(函数指针,普通指针,指针数组,数组的指针,指针的指针)
- C语言深度剖析之—指针与内存地址(函数指针,普通指针,指针数组,数组的指针,指针的指针)
- <C语言>特殊指针——const指针、void指针、NULL指针、零指针、野指针
- C和指针读书笔记——指针
- C指针——函数指针
- C指针——函数指针
- C指针——函数指针
- C指针——函数指针
- C指针——函数指针
- C指针——函数指针
- C指针——函数指针
- 设计模式有感
- 函数原型和函数
- ubuntu 14.04 64位 桌面版 中文输入法安装
- boa.conf基本配置详解
- 算法#01--素数和牛顿迭代法求平方根
- c——————指针之易错点
- Routable-iOS
- log4j使用教程详解(怎么使用log4j2)
- 我的职场路
- 两个引用的库v4包冲突
- 第1周 项目(A)-9如何购买玫瑰?
- Android定时服务
- 自定义下拉刷新ListView
- android Matrix