time()提供了秒级的精确度 .1、头文件 2、函数原型 time_t
time(time_t * timer) 函数返回从TC1970-1-1 0:0:0开始到现在的秒数
用time()函数结合其他函数(如:localtime、gmtime、asctime、ctime)可以获得当前...
分类:
其他好文 时间:
2014-05-09 10:20:45
阅读次数:
343
由于一字节的对齐问题,我调一个库调了我基本一个下午.....犯错其实并不可怕,可怕的是你一犯再犯......这也算得上是难能可贵.../Zp (Struct
Member Alignment)Visual Studio 2013Other VersionsThis topic has not yet...
分类:
其他好文 时间:
2014-05-09 09:40:28
阅读次数:
306
#include
using namespace std;
const int MAXQSIZE = 5;
//队列类
template
struct LinkList
{
T * data;//指向连续的数据存储区域
int front;//头指针 指向第一个元素
int rear;//尾指针 如果队列不为空指向最后元素的下一个位置
};
//构造一个空队列
template
void...
分类:
其他好文 时间:
2014-05-09 06:07:53
阅读次数:
248
void AudioGrabber::saveWave(const QString
&fileName, const QByteArray &raw, const QAudioFormat &format){
typedef struct{ char riff_fileid[4];//"RIFF" ...
分类:
其他好文 时间:
2014-05-09 05:01:23
阅读次数:
434
题目来源:HDU 3081 Marriage Match II
题意:
思路:
错误代码 纠结不知道哪错了 先放一放
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 1010;
const int INF = 999999999;
struct Edg...
分类:
其他好文 时间:
2014-05-09 02:38:25
阅读次数:
264
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
测试程序:
#include
#include
struct dev
{
int a;
char b;
float c;
};
struct dev devs[]=
{
{
1,'a',7.0,
},
{
1,'a',7.0,
},
{
...
分类:
系统相关 时间:
2014-05-09 02:10:16
阅读次数:
494
fstat函数用于返回关于文件的信息到一个struct stat结构中,stat结构中的st_mode可以用来区分文件类型。
struct stat {
dev_t st_dev; /* ID of device containing file */
ino_t st_ino; /* inode ...
分类:
其他好文 时间:
2014-05-09 02:01:26
阅读次数:
379
#include
#include
#define FALSE 0 //函数执行错误返回0
#define TRUE 1 //函数执行正确返回1
//串的堆分配存储表示
typedef struct
{
char *ch;
int length;
}String;
//对串的所有操作都可以通过以下五个基本函数实现
void StrInit(String *);//串的初始化...
分类:
其他好文 时间:
2014-05-09 01:25:02
阅读次数:
294
题目链接简单题,就是从单链表中删除重复元素。附上代码: 1 /** 2 * Definition
for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6
* L...
分类:
其他好文 时间:
2014-05-08 18:02:52
阅读次数:
338
闲来没事,看了看sqlite的源码,突然想用c实现c++,写了如下demo
#include
#include
struct Class;
typedef struct Class _Class;
struct IMethod
{
void (*ctor)(_Class *c);
void (*dtor)(_Class *c);
int (*sum)(_Class* c);
in...
分类:
编程语言 时间:
2014-05-08 16:14:30
阅读次数:
363