随笔分类 -  c program

在Eclipse中进行HotSpot的源码调试--转
摘要:原文地址:http://www.linuxidc.com/Linux/2015-05/117250.htm 在阅读OpenJDK源码的过程中,经常需要运行、调试程序来帮助理解。我们现在已经可以编译出一个调试版本HotSpot虚拟机,禁用优化,并带有符号信息,这样就可以使用GDB来进行调试了。许多对虚 阅读全文
posted @ 2016-03-31 18:38 一天不进步,就是退步 阅读(908) 评论(0) 推荐(0) 编辑
C/C++ unit testing tools (39 found)---reference
摘要:http://www.opensourcetesting.org/unit_c.phpAPI Sanity AutoTestDescription:An automatic generator of basic unit tests for a shared C/C++ library. It helps to quickly generate simple ("sanity" or "shallow"-quality) test cases for every function in an API using their signatures, dat 阅读全文
posted @ 2014-02-24 22:34 一天不进步,就是退步 阅读(591) 评论(0) 推荐(0) 编辑
C语言中extern的用法--转
摘要:http://blog.sina.com.cn/s/blog_52deb9d50100ml6y.html在C语言中,修饰符extern用在变量或者函数的声明前,用来说明“此变量/函数是在别处定义的,要在此处引用”。1. extern修饰变量的声明。举例来说,如果文件a.c需要引用b.c中变量int v,就可以在a.c中声明extern int v,然后就可以引用变量v。这里需要注意的是,被引用的变量v的链接属性必须是外链接(external)的,也就是说a.c要引用到v,不只是取决于在a.c中声明extern int v,还取决于变量v本身是能够被引用到的。这涉及到c语言的另外一个话题--变量 阅读全文
posted @ 2014-02-11 10:37 一天不进步,就是退步 阅读(3636) 评论(0) 推荐(0) 编辑
Linux中常用头文件的作用--转
摘要:http://blog.sina.com.cn/s/blog_5c93b2ab0100q62k.html1、 Linux中一些头文件的作用::ANSIC。提供断言,assert(表达式):GCC。GTK,GNOME的基础库,提供很多有用的函数,如有数据结构操作函数。使用glib只需要包含:GCC。文件夹操作函数。structdirent,struct DIR,opendir(),closedir(),readdir(),readdir64()等:ANSIC。字符测试函数。isdigit(),islower()等:ANSIC。查看错误代码errno是调试程序的一个重要方法。当linuc C ap 阅读全文
posted @ 2014-01-15 01:19 一天不进步,就是退步 阅读(3163) 评论(0) 推荐(0) 编辑
用C语言实现Ping程序功能---转
摘要:ping命令是用来查看网络上另一个主机系统的网络连接是否正常的一个工具。ping命令的工作原理是:向网络上的另一个主机系统发送ICMP报文,如果指定系统得到了报文,它将把报文一模一样地传回给发送者,这有点象潜水艇声纳系统中使用的发声装置。例如,在Linux终端上执行ping localhost命令将会看到以下结果:PING localhost.localdomain (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=0 ttl=2 阅读全文
posted @ 2014-01-08 10:40 一天不进步,就是退步 阅读(1175) 评论(0) 推荐(0) 编辑
How to Install Eclipse C/C++ Development Tool--转
摘要:http://www3.ntu.edu.sg/home/ehchua/programming/howto/EclipseCpp_HowTo.htmlEclipse 4.3 (Kepler) for C/C++ ProgrammingHow To Install Eclipse CDT 8.2 and Get StartedEclipse is an open-source Integrated Development Environment (IDE) supported by IBM. The mother site is @ www.eclipse.org. Eclipse is popu 阅读全文
posted @ 2014-01-07 14:58 一天不进步,就是退步 阅读(3352) 评论(0) 推荐(0) 编辑
c之指针与数组(2)Dynamic Data Structures: Malloc and Free--转载
摘要:http://www.howstuffworks.com/c29.htmhttp://computer.howstuffworks.com/c.htmDynamic Data Structures: Malloc and FreeLet's say that you would like to allocate a certain amount of memory during the execution of your application. You can call the malloc function at any time, and it will request a bl 阅读全文
posted @ 2013-12-06 09:02 一天不进步,就是退步 阅读(405) 评论(0) 推荐(0) 编辑
指向函数的指针--转
摘要:http://book.51cto.com/art/200908/146363.htm5.1.2 指向函数的指针C语言通过&和*操作符来操作数据的地址,但它并没有提供一个用一般的方式来操作代码的地址。然而,C语言并没有完全切断程序员操作代码地址的可能,它提供了一些"受限制的"方式来操作代码的地址。之所以说这些方式是"受限制的",那是因为这些方式并不像操作数据地址那样自由和灵活。在C语言中,指针变量也可以指向一个函数。我们已经知道代码也是有地址的,一个函数在编译时会被分配给一个入口地址,这个入口地址就是该函数中第一条指令的地址,这就是该函数的指针。 阅读全文
posted @ 2013-12-04 09:41 一天不进步,就是退步 阅读(500) 评论(0) 推荐(0) 编辑
c之指针与数组(1)
摘要:1.指针与地址一元运算符&可用于取一个对象的地址。例如:int i=1;&i就是计算机地址。一元运算符*是间接寻址或者间接引用运算符。例如:int x=1,y;int ip*;ip=&xy=*ip;2.指针与函数参数 c语言是以传值的方式将参数值传递给被调用函数,因此被调用函数不能直接修改主调函数中变量的值。例如:void swap(int x,int y){ int temp; temp=x; x=y; y=temp}swap不能交换两个变量x,y的值。可以使主调程序将指向所要交换的变量的指针传递给被调用函数,即swap(&a,&b);void swa 阅读全文
posted @ 2013-12-04 09:24 一天不进步,就是退步 阅读(231) 评论(0) 推荐(0) 编辑
C语言读写配置文件--转载
摘要:http://www.oschina.net/code/snippet_4873_2503[1].[代码] CException.h 跳至 [1] [2] [3]/************************************************************************//* make0000@msn.com *//************************************************************************//*******************************... 阅读全文
posted @ 2013-12-02 23:16 一天不进步,就是退步 阅读(1306) 评论(0) 推荐(0) 编辑
A GDB Tutorial with Examples--转
摘要:http://www.cprogramming.com/gdb.htmlA GDB Tutorial with ExamplesBy Manasij MukherjeeA good debugger is one of the most important tools in a programmer's toolkit. On a UNIX or Linux system, GDB (the GNU debugger) is a powerful and popular debugging tool; it lets you do whatever you like with your 阅读全文
posted @ 2013-11-30 00:29 一天不进步,就是退步 阅读(978) 评论(0) 推荐(0) 编辑