1、生成动态链接库[root@typhoeus79 c]# more head.c #include #include typedef struct _point{ int x; int y;}Point;Point * InitPoint(int x,int y){ Point ...
分类:
编程语言 时间:
2014-06-18 15:45:00
阅读次数:
267
在同一个结构体中,定义不同的构造函数,如果传值类型相同,但是外部名称不一样,可以当做不同的构造函数,这就java的区别很大,例子如下:struct Celsius { var temperatureIC: Double = 0.0 init(fF fahrenheit: Double){ ...
分类:
其他好文 时间:
2014-06-18 15:32:04
阅读次数:
181
基数排序
一、基数排序是一种非比较型整数排序算法,其原理是将整数按位数切割成不同的数字,然后按每个位数分别比较。
其实现原理:将所有待比较数值(正整数)统一为同样的数位长度,数位较短的数前面补零。然后,从最低位开始,依次进行一次排序。这样从最低位排序一直到最高位排序完成以后,
数列就变成一个有序序列。
二、具体操作:此排序的真正实现是通过队列的装置,先进先出...
分类:
其他好文 时间:
2014-06-18 07:30:25
阅读次数:
188
1.
Python虚拟机会从编译得到的PyCodeObject对象中依次读入每一条字节码指令,
并在当前的上下文环境中执行这条字节码指令。
Python虚拟机实际上是在模拟操作中执行文件的过程
PyCodeObject对象中包含了字节码指令以及程序的所有静态信息,但没有包含
程序运行时的动态信息——执行环境(PyFrameObject)
2.Python源码中的PyFrameObject
typedef struct _frame{
PyObject_VAR_HEAD //"运行时栈"的大小是不确定的...
分类:
编程语言 时间:
2014-06-18 06:33:24
阅读次数:
323
引言:数据经常以成组的形式存在。在C中,使用结构可以把不同类型的值存放在一起。
结构的声明有两种
1、struct SIMPLE{
int a;
char b;
float c;
};然后用标签SIMPLE去声明结构体变量。
2、typedef struct{
int a;
char b;
float c;
}Simple;然后用Simple去声明结构体变量。此时Simple...
分类:
编程语言 时间:
2014-06-17 23:22:29
阅读次数:
200
#import
typedef struct students{
}Stu;
int main(int argc, const char * argv[])
{
//结构体,里面的是成员(变量)
struct teacher {
char name[30];
char sex;
int age;
...
分类:
编程语言 时间:
2014-06-17 22:48:22
阅读次数:
324
bool CDlgResetAlarmInfo::GetLocalUserNameAddIP(CString &a_lstrUserName ,CString &a_IpStr)
{
char buf[256]="";
WSADATA w;
WSAStartup(0x0101, &w);
struct hostent *ph = 0;
gethostname(buf, 256)...
分类:
编程语言 时间:
2014-06-17 16:38:03
阅读次数:
223
#include#includeusing namespace std;struct Food{ double x,y;}food[1005]; int cmp(Food i,Food j){ return i.x*j.y>j.x*i.y;}int main(){ double s,m; int i...
分类:
其他好文 时间:
2014-06-17 15:31:19
阅读次数:
160
#include "stdafx.h"#include "stdlib.h"typedef struct Node{ int data; struct Node* next;} LinkNode;void PrintNodes(LinkNode *&List){ LinkNode ...
分类:
其他好文 时间:
2014-06-17 15:25:14
阅读次数:
158
简单来说,就是二叉树的前序、中序、后序遍历,包括了递归和非递归的方法前序遍历(注释中的为递归版本): 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 struct TreeNode 9 {1...
分类:
其他好文 时间:
2014-06-17 12:53:42
阅读次数:
416