- 博客(8)
- 资源 (3)
- 收藏
- 关注
原创 常见IO错误码和Errno错误码笔记
常见IO错误码及原因 错误代码 原因 备注 EACCESS 访问动作被拒绝,权限不足 EAFNOSUPPORT 网络地址类型未支援 #include <errno.h>#include <string.h>#include <stdio.h>int main(){ int errn=0; int unkown = 0; while(
2015-04-21 15:21:16
1359
原创 linux C pop邮件到本地笔记
#include "popeml.h"void SetSocketConnect(char *server,int *sockfd){ int nREUSEADDR = 1; //socket可重用 char IPaddr[24]; struct hostent *hp = NULL; struct sockaddr_in addr; hp
2014-11-10 12:03:24
554
转载 shell中$0,$?,$!等的特殊用法以及1>/dev/null 2>&1的含义
shell中可能经常能看到:>/dev/null 2>&1 命令的结果可以通过%>的形式来定义输出/dev/null 代表空设备文件> 代表重定向到哪里,例如:echo "123" > /home/123.txt1 表示stdout标准输出,系统默认值是1,所以">/dev/null"等同于"1>/dev/null"2 表示stderr标准错误& 表示等同于的意思,
2014-10-13 08:57:29
2081
原创 C语言编写读取配置文件程序
#include "readconf.h"CONFIGURE *GetConfData(){ CONFIGURE *pConf; pConf = (CONFIGURE*)malloc(sizeof(CONFIGURE)); memset(pConf, 0x0, sizeof(CONFIGURE)); //InitialConf(pConf); if( access("confi
2013-02-26 10:39:38
858
原创 字母大小写转换经典程序
static void _str_toupper(char *src, char *dst) //小写转大写{ while (*src) { *dst++ = *src++; if (dst[-1] >= 'a' && dst[-1] <= 'z') dst[-1] ^= 0x20; }}static void _str_tolower(char *src, char
2013-02-26 10:35:30
2766
原创 递归读取文件目录结构
#include #include #include #include #include #include //for errno#include /*递归读取文件目录结构*/void readdir_fun(char *path,int classlevel);int main(int argc,char *argv[]){ char *pat
2013-02-26 10:33:16
1326
原创 C语言编写的进程进度条显示程序
void progress_update(unsigned long total_max, unsigned long total_val, int child_max, int child_val, struct timeval *last_refresh ){ double total_percent, child_percent; int i;
2013-02-26 10:27:57
4332
原创 linux c方式 从www.ip138.com获取IP数据
#include "stdio.h"#include "stdlib.h"#include "string.h"#define WIN32 a.c#ifdef WIN32 #include "windows.h" #include #pragma comment(lib,"ws2_32") #else #include #
2013-02-26 10:23:34
1960
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人