
C
文章平均质量分 59
ColorPaper
游侠
展开
-
C语言的标准版本
<br /> C语言的标准版本<br />C89<br />In 1983, the American National Standards Institute formed a committee, X3J11, to establish a standard specification of C. After a long and arduous process, the standard was completed in 1989 and ratified as原创 2010-12-27 22:17:00 · 668 阅读 · 0 评论 -
推荐几本C语言的好书!!!!
以下是csdn里的前辈所陈述,我来应用一下,也和大家分享一下! 。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 (一)语言入门: 《C++ Primer》 最新版本:第三版(第四版国外已上架,国内一些网上书店也在预订中) 适合有丰富C经验,缺乏C++经验转载 2012-03-21 17:45:45 · 1563 阅读 · 0 评论 -
Segmentation fault (core dumped)
Segmentation fault (core dumped)问:I am relatively new on C, I am trying to run a simple program and I get this Error message: Segmentation fault (core dumped) I just want to print any va转载 2012-04-23 11:40:50 · 886 阅读 · 0 评论 -
在linux下使用汇编语言
Using Assembly Language in Linux.Last updated: Monday 8th January 2001Note: there is a turkish translation of this article.Contents:IntroductionIntel and AT&T SyntaxPrefixesD转载 2012-04-26 14:05:32 · 823 阅读 · 0 评论 -
因特尔SSE指令教程
Intel SSE Tutorial : An Introduction to the SSE Instruction SetTable of Contents+ Introduction, Prerequisites, and Summary+ SSE Introstructions+ Example 1: Adding Vectors+ Shuffling+转载 2012-04-26 14:07:56 · 2104 阅读 · 0 评论 -
gcc编译优化等级的区别
问:What is the difference between different optimization levels in GCC? Assuming I don't care to have any debug hooks, why wouldn't I just use the highest level of optimization available to me? doe转载 2012-04-26 14:13:14 · 1536 阅读 · 0 评论 -
gcc 头文件搜索路径
Include的header文件,连结数据库,系统定义,总共有下列来源指定gcc去那找。 当初在编译时指定的(在~gcc/gcc/collect2.c:locatelib() 写在specs内的 后来用-D -I -L指定的 gcc环境变量设定(编译的时候) ld.so的环境变量(这是run time的时候) 一、头文件 gcc 在编译时如何去寻找所需要的头文件 :转载 2012-04-19 09:06:16 · 567 阅读 · 0 评论 -
Linux命令之ar - 创建静态库.a文件
Linux命令之ar - 创建静态库.a文件 用途说明 创建静态库。a文件。用C/C++开发程序时经常用到,但我很少单独在命令行中使用ar命令,一般写在makefile中,有时也会在shell脚 本中用到。 用途说明 创建静态库。a文件。用C/C++开发程序时经常用到,但我很少单独在命令行中使用ar命令,一般写在makefile中,有时也会在shell脚 本中用到。关于Linux转载 2012-04-21 18:02:56 · 699 阅读 · 0 评论 -
GNU Compiler for Java
GNU Compiler for JavaFrom Wikipedia, the free encyclopediaGNU Compiler for JavaDeveloper(s)The GNU ProjectOperating systemUnix-likeTypeCompilerLic转载 2012-06-18 12:36:35 · 833 阅读 · 0 评论 -
C++ Error: free(): invalid next size (fast):
It means that you have a memory error. You may be trying to free a pointer that wasn't allocated bymalloc (or delete an object that wasn't created by new) or you may be trying to free/deletesuch转载 2012-07-12 14:21:50 · 1782 阅读 · 0 评论 -
*** glibc detected *** free(): invalid next size (fast) — should work?
问:I'm working on an existing c project (spglib on sourceforge), and I'm running into the following problem after cleaning up some array initializations:* glibc detected tests/spglibtest:转载 2012-07-12 14:23:45 · 2088 阅读 · 0 评论 -
C函数中指针参数
在C语言中,经常需要使用指针参数,使用指针参数的特点是:(1)在函数里可以修改指针参数所指向的对象(2)在函数里但不能改变指针本身的值(让指针指向不同的对象)。void func(void *p)typedef struct size{ float width; float height;}size_tvoid func(size_t * siz原创 2012-08-09 21:07:55 · 653 阅读 · 0 评论 -
FLOAT类型的值域
小数在C#中需要用浮点型表示,浮点值就是.后面的小数点。C#语言中有两种小数类型,分别为32位单精度浮点型(float)和64位双精度浮点型(double)。其中精度指的是小数位数,小数位数越多,精度越高。由名称可知,float类型的精度比double型的低,由位数可知,float类型的范围比double类型小。 float类型中小数位数为7位,即可精确到小数点后7位,表示范围为1.5e -转载 2012-09-27 13:19:53 · 3348 阅读 · 0 评论 -
C语言宏的高级用法
#define START_THREAD(name,param) start_thread(get_thread_idx(#name), param)#define JOIN_THREAD(name) join_thread(get_thread_idx(#name))#define CHANGE_THREAD_PRIO(name, priority) change_thr原创 2012-10-30 16:23:59 · 1039 阅读 · 0 评论 -
pthread_cond_wait与pthread_cond_signal
pthread_cond_wait 多线程的条件变量 [1] 条件变量是利用线程间共享的全局变量进行同步的一种机制,主要包括两个动作:一个线程等待"条件变量的条件成立"而挂起;另一个线程使"条件成立"(给出条件成立信号)。为了防止竞争,条件变量的使用总是和一个互斥锁结合在一起。 1. 创建和注销 条件变量和互斥锁一样,都有静态动态两种创建转载 2012-11-20 15:10:55 · 702 阅读 · 0 评论 -
c exit status
25.6.2 Exit StatusWhen a program exits, it can return to the parent process a smallamount of information about the cause of termination, using theexit status. This is a value between 0 and 255 that转载 2012-03-12 10:14:02 · 713 阅读 · 0 评论 -
libc syslog
18 SyslogThis chapter describes facilities for issuing and logging messages ofsystem administration interest. This chapter has nothing to do withprograms issuing messages to their own users or keepi转载 2012-03-08 12:41:04 · 880 阅读 · 0 评论 -
C中如何创建.tar.bz2文件
问题I need to create a tarball of a directory and then compress it with bz2 in C++. Is there any decent tutorial on using libtar and libbz2?解决方法Okay, I worked up a quick example for you.转载 2012-03-06 11:41:47 · 1077 阅读 · 0 评论 -
fgetc getc getchar fputc putc putchar
fgetc getc getchar fputc putc putcharfgetc 调用方式:int fgetc( FILE *stream )功能Read a character(字符当作unsigned char类型来读取,然后转换为int类型) from a stream。返回值Fgetc return t原创 2010-12-24 22:48:00 · 1123 阅读 · 0 评论 -
与终止程序相关的函数
<br />exit<br /> <br />Performs complete C library termination procedures, terminates the process, and exits with the supplied status code.<br /> <br />voidexit(intstatus);<br /> <br />Required Header <stdlib.h><br />Parameter status Exit status<br />Re转载 2010-12-27 22:18:00 · 686 阅读 · 0 评论 -
C文件边读边写
<br />C文件边读边写<br /> <br />首先以读写方式打开(r+ w+ a+都可以,不过要注意读写位置指针分别指向文件头、文件头、文件尾),一次读一个字符(此时读写位置指针指向此字节后面,判断后,若要转换,移动读写位置指针fseek(fp,-1L,SEEK_CUR),再写入,由于在C中规定: <br /> 以上述三种方式打开文件,既可读又可写,但:在没有插入fseek()或rewind()的情况下,写不可以直接跟在读后面,在没有插入fseek()rewind()或碰到文件结束的原创 2010-12-29 21:29:00 · 2473 阅读 · 0 评论 -
fgets gets fputs puts
<br /> fgets gets fputs puts <br /> <br />fgets<br />调用方式<br />char *fgets( char *string, int n, FILE *stream )<br />功能<br />Get a string from a stream.<br />返回值<br />Each of these functions returns string. NULL is原创 2011-01-09 18:10:00 · 778 阅读 · 0 评论 -
feof和ferror
feof和ferrorfeofTests for end-of-file on a stream.intfeof(FILE*stream);Return ValueThe feof function returns a nonzero value after the first read operation that attempts to read past the end of the file. It returns 0 if the current position is not转载 2011-01-09 18:56:00 · 873 阅读 · 0 评论 -
输入某年某月某日,判断这一天是这一年的第几天?
main(){int day,month,year,sum,leap;printf("\nplease input year,month,day\n");scanf("%d,%d,%d",&year,&month,&day);switch(month)/*先计算某月以前转载 2011-10-17 17:43:59 · 798 阅读 · 0 评论 -
Linux Semaphore Tutorial
1.Introduction to SemaphoresSemaphores can be thought of as simple counters that indicate the status of a resource. This counter is a protected variable and cannot be accessed by the user directly.转载 2012-02-14 11:00:22 · 950 阅读 · 0 评论 -
perror
头文件 #includestdio.h> #include//注意 不可以掉了这个头文件,perror是包含在这个文件里的定义函数 void perror(const char *s); perror ("open_port");函数说明 perror ( )用 来 将 上 一 个 函 数 发 生 错 误 的 原 因 输 出 到 标 准 设备 (stderr)转载 2012-02-14 13:44:45 · 626 阅读 · 0 评论 -
Linux Deamon编程方法
守护进程(Daemon)是运行在后台的一种特殊进程。它独立于控制终端并且周期性地执行某种任务或等待处理某些发生的事件。守护进程是一种很有用的进程。 Linux的大多数服务器就是用守护进程实现的。比如,Internet服务器inetd,Web服务器httpd等。同时,守护进程完成许多系统任务。比如,作业规划进程crond,打印进程lpd等。守护进程的编程本身并不复杂,复杂的是各种版本的Uni转载 2012-02-14 13:43:50 · 625 阅读 · 0 评论 -
c/c++在线编译器
c/c++在线编译器一直以来都喜欢用手机看书,尤其是在上班时。看的最多的是编程一类的书,主要是C++,看着就想写写代码,可是电脑用不能用,怎么办?于是想到用UC浏览器找找看网上有没有在线的编译器,想什么时候写代码都可以验证。于是就找了几个,各有千秋吧。中文的我没找到,全是英文的,不过英文不难,其实也不需要懂英文,只要知道在什么地方写代码,然后点击按钮进行在线编译就行了。好了转载 2012-02-23 20:17:05 · 786 阅读 · 0 评论 -
格式化输出函数printf
int printf ( const char * format, ... );Print formatted data to stdoutWrites to the standard output (stdout) a sequence of data formatted as the format argument specifies. After the format par转载 2012-02-23 21:44:24 · 723 阅读 · 0 评论 -
精灵进程(daemon)编程规则
精灵进程(daemon)是生存期长的一种进程。它们常常在系统引导装入时起动,在系统关闭时终止。因为它们没有控制终端,所以说它们是在后台运行的。UNIX系统有很多精灵进程,它们执行日常事物活动。我们在编写程序时往往要用到精灵进程,下面介绍精灵进程的编程规则,并给出示例。1:调用fork产生一个子进程,同时父进程退出。我们所有后续工作都在子进程中完成。这样做我们可以:如果我们是转载 2012-02-15 22:01:59 · 730 阅读 · 0 评论 -
C语言真正获取随机数
问题1:怎样获得一个真正的随机数?要知道,rand()是不能产生真正的随机数的!即使不能产生真正的随机数,也要大概接近呀!而rand()好象每次的随机都一样。专家解答:之所以rand()每次的随机数都一样是因为rand()函数使用不正确。各种编程语言返回的随机数(确切地说是伪随机数)实际上都是根据递推公式计算的一组数值,当序列足够长,这组数值近似满足均匀分布。如果计算伪随机序列的初始数值(转载 2012-02-20 15:47:20 · 2429 阅读 · 0 评论 -
C++ vs Objective C
Are you a game developer transitioning from Cocos2d iPhone to Cocos2d-X? From Objective C to C++?C++ used to be my language. It was all I wrote computer games in for over 10 years. There's a certain转载 2013-01-01 13:24:09 · 1278 阅读 · 0 评论