要想使用C语言来获取当前系统的时间,办法如下: 需要提前准备的工作: 1 #include 2 #include 3 #include 4 5 int main() 6 { 7 time_t rawtime; //时间类型,由time.h中定义 8 struct ...
分类:
编程语言 时间:
2014-09-05 23:45:42
阅读次数:
319
linux kernel将关键信息保存到文件做法 很好的调试方法
下面有2个示例:
1:保存机器从开机到结束的VBATT;
2:保存uart接收到的数据到文件;
意义不多说了。
以下是代码:
#include
#include
#include
static struct file *fp =NULL;
int write_to_file...
分类:
系统相关 时间:
2014-09-05 22:28:22
阅读次数:
318
//那个单词是有出现的两个单词构成的
# include
# include
# include
# include
# define MAX 26
using namespace std;
typedef struct Trie_Node
{
bool isWord;
struct Trie_Node *next[MAX];
} Trie;
char s[50000][5...
分类:
其他好文 时间:
2014-09-05 19:57:51
阅读次数:
207
1、定义结构体的这种写法会导致调试时不能监视结构体成员变量 typedef struct listnode { int data; struct listnode *next; }listnode; 两个listnode相同导致上述问题。 2、交换两个数的问题 用位运算和无中间值得方法,若交换的两个...
分类:
其他好文 时间:
2014-09-05 17:48:41
阅读次数:
202
二叉树的先序、中序、后序、层次遍历的递归和非递归解法
package tree;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;
public class TreeTraverse {
/**
* 先序递归
* @param root
*/
public stat...
分类:
其他好文 时间:
2014-09-05 16:12:21
阅读次数:
249
文件操作的系统函数: open函数,close函数,read函数,write函数,getcwd函数,access函数,stat函数,fstat函数 函数原型: 1:open函数 功能:打开现有的文件,或者创建新文件并打开:,成功返回值是文件标识号,失败为-1 参数:parhname是文件路径,fla...
分类:
系统相关 时间:
2014-09-05 16:02:21
阅读次数:
313
#include#includeusing namespace std;#define MAX 99999int father[MAX];struct Edge{ int a; int b; int dist; bool operatore.dist) return true...
分类:
其他好文 时间:
2014-09-05 15:58:31
阅读次数:
220
1. [代码]最简单的例子 # CStruct Examplesrequire 'cstruct'# example:# struct Point in C\C++ (32-bit platform):## struct Point# {# int x;# int y;# };# str...
分类:
其他好文 时间:
2014-09-05 15:50:51
阅读次数:
260
C++新手在指定结构成员时,不知道何时用.运算符,何时是用->运算符。结论:如果结构标识符是结构名,则使用句点运算符;如果标识符是指向结构的指针,则使用箭头运算符。#include struct inflatable{ char name[20]; float volume; do...
分类:
编程语言 时间:
2014-09-05 14:17:31
阅读次数:
363
几个问题:1.libevent到底用的是select还是iocp,然后是如何突破64限制的typedef struct fd_set { u_int fd_count; /* how many are SET? */ SOCKET fd_...
分类:
其他好文 时间:
2014-09-05 14:15:41
阅读次数:
191