码迷,mamicode.com
首页 >  
搜索关键字:struct enum    ( 22969个结果
c语言的结构体字节数统计
struct结构体的字节数 等于 结构体中最大类型的字节数的倍数。如:typedef struct Student{ short id; //2个字节 char name[15]; //1*15个字节 int age; //4个字节 char num; //1个字节} Student;总共28个字节...
分类:编程语言   时间:2014-06-25 21:13:46    阅读次数:235
LeetCode Linked List Cycle
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *...
分类:其他好文   时间:2014-06-25 21:00:45    阅读次数:200
MFC 错误异常,用vs添加资源并为资源定义类后报错:error C2065 : 未声明的标识符
添加了一个Dialog资源,修改了ID之后右击资源添加了一个类,在类里面有一个成员变量:// 对话框数据 enum { IDD = IDD_GETIN };而在编译过程中出现报错,错误代号是error C2065 : 未声明的标识符,我的第一反应是为什么我没通过手动添加资源而是通过VS添加都会出现这...
分类:其他好文   时间:2014-06-25 20:45:45    阅读次数:223
二叉搜索树的建立
二叉搜索树最大特征是:左边子结点的值#include #include typedef struct NODE{ NODE * pleft; NODE * pright; int ivalue;} node;/* 错误示例,实际上这个函数并没有连接起新建的结点void inser...
分类:其他好文   时间:2014-06-25 20:24:38    阅读次数:192
C++链表-最简单
struct student{ long num; float score; struct student *next;};注意:只是定义了一个struct student类型,并未实际分配存储空间。只有定义了变量才分配内存单元。#includeusing namespace std;int mai...
分类:编程语言   时间:2014-06-24 22:24:45    阅读次数:318
Effective C++:条款28:避免返回 handles 指向对象内部成员
(一) 有时候为了让一个对象尽量小,可以把数据放在另外一个辅助的struct中,然后再让一个类去指向它。看下面的代码: class Point { public: Point(int x, int y); void setX(int newVal); void setY(int newVal); }; struct RectData { Point ulhc; Point lrhc...
分类:编程语言   时间:2014-06-24 22:17:30    阅读次数:240
LeetCode Validate Binary Search Tree
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:其他好文   时间:2014-06-24 13:40:33    阅读次数:214
LeetCode Balanced Binary Tree
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:其他好文   时间:2014-06-24 13:32:40    阅读次数:157
c++ 接口
c++ primer说公有的函数就是接口现在项目中struct I_XX{ virtual void test() = 0;};这个test才被称作接口,我就不知道什么到底是接口,貌似这种说靠谱点接口有不同层次的定义, 比如C++通常把类的公用成员函数函数说成接口; 比如,我们通常把Win API....
分类:编程语言   时间:2014-06-24 11:53:43    阅读次数:206
uva 11143
1 #include 2 #include 3 #include 4 #define maxn 5100 5 #include 6 using namespace std; 7 8 struct node 9 { 10 int x,y; 11 int id; 1...
分类:其他好文   时间:2014-06-24 11:04:10    阅读次数:150
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!