结构指针型函数
来源:互联网 发布:c语言中文网官网 编辑:程序博客网 时间:2024/06/18 05:06
#include <iostream>#include<string>using namespace std;struct sample{ int num; char color; char type;}car[] = {101,'G','c',201,'Y','m',105,'R','i',222,'B','s',308,'P','b',0,0,0};struct sample *find(int n);void main(){ int number; struct sample *result; cout<<"enter the number"; cin>>number; result = find(number); if (result->num!=NULL) { cout<<"number:"<<result->num<<endl; cout<<"color:"<<result->color<<endl; cout<<"type:"<<result->type<<endl; } else cout<<"not found"<<endl;}struct sample *find(int n){ int i; for(i = 0;car[i].num!=NULL;i++) if(car[i].num == n) break; return &car[i];}
0 0
- 结构指针型函数
- 函数指针,结构体指针
- 结构体指针函数
- 结构体、函数指针
- 结构体中的函数指针
- 函数指针 结构体struct
- 结构体中的函数指针
- 结构体中的函数指针
- 函数指针及结构体
- 结构体指针与函数
- 指针与结构体、函数指针
- 如何正确使用指针(指针作为输出型参数)与结构体指针作为函数参数
- 结构体、结构指针作为函数参数
- 函数指针&指针函数&结构体调用函数
- 结构体中的函数指针与函数
- 理解数组,结构 ,函数指针,指针函数,数组指针,指针数组,结构指针的定义和实现
- 结构体中指向函数的指针
- 结构体中指向函数的指针
- windows WinExec()
- 机器学习手记[5]--决策树方法学习
- Android之内存泄漏调试学习与总结
- Android大图片裁剪终极解决方案
- 机器学习手记[7-1]--PageRank算法
- 结构指针型函数
- 王立平--poser
- edgesForExtendedLayout ios7新特性
- Oracle Database Link基础
- Builder模式
- static和const关键字的作用
- 机器学习手记[6]---KNN算法
- Java面向对象
- Java基础下