<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ubuntu,debian,redhat -linuxany.com &#187; C/C++</title>
	<atom:link href="http://www.linuxany.com/archives/category/programming/cc/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxany.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Jan 2012 08:59:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>log4c使用—日志文件轮循</title>
		<link>http://www.linuxany.com/archives/1306.html</link>
		<comments>http://www.linuxany.com/archives/1306.html#comments</comments>
		<pubDate>Mon, 21 Jun 2010 14:56:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[appender]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[log4c]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1306</guid>
		<description><![CDATA[Log4c基本概念 Log4c中有三个重要的概念, Category, Appender, Layout。 Category用于区分不同的Logger, 其实它就是个logger。在一个程序中我们可以通过Category来指定很多的Logger，用于不同的目的。 Appender用于描述输出流，通过为Category来指定一个Appender，可以决定将log信息来输出到什么地方去，比如stdout, stderr, 文件, 或者是socket等等 Layout用于指定日志信息的格式，通过为Appender来指定一个Layout,可以决定log信息以何种格式来输出，比如是否有带有时间戳， 是否包含文件位置信息等，以及他们在一条log信息中的输出格式的等。 #include &#60;stdio.h&#62; #include &#60;stdlib.h&#62; #include &#60;string.h&#62; #include &#34;log4c.h&#34; &#160; #define&#160;LOG(fmt,args...) \ &#160; log_message(__FILE__, __LINE__, __FUNCTION__,fmt ,## args); &#160; static&#160;int LOGNUM = 0; &#160; const&#160;char *format = &#34;%-5dFunction %20s at line %-5d in file %20s;&#34;; &#160; log4c_category_t* mycat = NULL; &#160; static&#160;void log_message(char* [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1306.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在vim/vi中快速执行php或c/c++的方法</title>
		<link>http://www.linuxany.com/archives/1277.html</link>
		<comments>http://www.linuxany.com/archives/1277.html#comments</comments>
		<pubDate>Wed, 26 May 2010 11:57:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[vimrc]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1277</guid>
		<description><![CDATA[如果使用VIM来编写代码，可能很多朋友就会想了，有没有什么方法来建立一个快捷键，能快速的运行我们所编写的代码呢？！！答案当然是肯定了的，不然也不会写这篇日志来讨论这个问题了。 在介绍方法之前，先来谈一下自己以前的执行方式吧！ 先拿PHP来讲吧，最传统的方式就是将编写好的代码放在apache的根目录，然后通过浏览器来运行，或者使用php命令来运行php.可以使用php的r参数 linuxany@~$ php -r &#34;echo 'hqlong';&#34; 来快速测试，或者使用q参数 linuxany@~$ php -q test.php 来运行。 接下来讲怎么将vim支持一键执行。 大致原理是使用键盘映射，将快捷键映射到执行的命令。 在.vimrc中添加 nmap &#60; F5 &#62; &#60; ESC &#62;:!clear &#38;&#38; php -q &#60; C-R &#62;%&#60; cr &#62; 即当我们按下F5时，就相当于执行了如下操作。 1.按下ESC，然后再按下:,进入vim命令行模式 2.执行clear清屏操作。 3.然后运行当前脚本。 4.最后执行回车操作. 下面有几个指令需要解释一下: < C - R >%:得到当前文件的名字,包括路径.(按ctrl+r,然后再按%) 接下来可以测试一下. vim /tmp/test.php &#60; ? php &#160; &#160; echo&#160;&#34;hqlong&#34;; ?&#62; 保存后,按F5, 就是快速的得出执行结果。 [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1277.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c语言中的字符串分割(strstr)</title>
		<link>http://www.linuxany.com/archives/1237.html</link>
		<comments>http://www.linuxany.com/archives/1237.html#comments</comments>
		<pubDate>Wed, 07 Apr 2010 04:25:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[ctype]]></category>
		<category><![CDATA[needle]]></category>
		<category><![CDATA[strstr]]></category>
		<category><![CDATA[strtok]]></category>
		<category><![CDATA[token]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1237</guid>
		<description><![CDATA[在前面C语言中利用strtok函数进行字符串分割介绍的strtok函数，比较适合多个字符（也就是字符串）作分隔符的场合，而很多时候我们仅仅需要某一个特定的字符来分割字符串，当然利用strtok也可以实现，不过这里介绍的strstr效率上来说更加适合。 原型：extern char *strstr(char *haystack, char *needle);所在头文件：#include &#60;string.h&#62;功能：从字符串haystack中寻找needle第一次出现的位置（不比较结束符NULL)。说明：返回指向第一次出现needle位置的指针，如果没找到则返回NULL。 int main(int argc,char **argv) { char&#160;temp[10]; char *haystack=&#34;aaa&#124;&#124;a&#124;&#124;bbb&#124;&#124;c&#124;&#124;ee&#124;&#124;&#34;; char *needle=&#34;&#124;&#124;&#34;; char* buf = strstr( haystack, needle); while(&#160;buf != NULL ) { strncpy(temp, haystack, buf-haystack); temp[buf-haystack] =0; printf(&#160;&#34;%s\n &#34;, temp); //haystack); &#160; haystack = buf + strlen(needle); &#160; buf = strstr(&#160;haystack, needle); } return&#160;0; } 您还可能感兴趣的内容查找指定字符串在另一字符串中的位置(strpos)]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1237.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C语言中几种指针的指针用法</title>
		<link>http://www.linuxany.com/archives/1231.html</link>
		<comments>http://www.linuxany.com/archives/1231.html#comments</comments>
		<pubDate>Fri, 26 Feb 2010 15:47:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[malloc]]></category>
		<category><![CDATA[pointer]]></category>
		<category><![CDATA[sizeof]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1231</guid>
		<description><![CDATA[1、 简单来说 int **p 是一个指向2维数组的指针。 数学上一个2维数组描述有NR行，NC列的矩阵，例如 int a[NR][NC]; 为了使程序有通用性，编程时不把这个数组行列数定死，而让使用者临时输入行列数，再动态分配数组存放单元，这时，我们声明一个2维数组的指针(或叫二重指针）。 int NR,NC; int **a; int i,j; &#160; // 假定键盘输入 NR=5，NC=3，动态分配数组: a = (int **)&#160;malloc(sizeof(int *) * NR); for&#160;(j=0;j&#60;NR;j++) a[j] = (int *) malloc(sizeof(int) * NC); // 现在可以直接用 a[j][i] 作运算，不用管 数组元素的地址。 // 例如： for&#160;(j=0;j&#60;NR;j++) for (i=0;i&#60;NC;i++) {&#160; a[j][i] = (j+1)*100 + i; }; &#160; for&#160;(j=0;j&#60;NR;j++){&#160; for&#160;(i=0;i&#60;NC;i++) printf(&#34;%3d [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1231.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决Debian5编译环境头文件异常的办法</title>
		<link>http://www.linuxany.com/archives/1227.html</link>
		<comments>http://www.linuxany.com/archives/1227.html#comments</comments>
		<pubDate>Tue, 23 Feb 2010 00:43:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[cdt]]></category>
		<category><![CDATA[debian5]]></category>
		<category><![CDATA[ECLIPSE]]></category>
		<category><![CDATA[g++]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[include]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1227</guid>
		<description><![CDATA[在编译时使用下列包含位置即可：（注意顺序） 适用于gcc,g++ 32位： /usr/local/include/usr/lib/gcc/i486-linux-gnu/4.3.2/include/usr/lib/gcc/i486-linux-gnu/4.3.2/include-fixed/usr/include 64位 /usr/local/include/usr/lib/gcc/x86_64-linux-gnu/4.3.2/include/usr/lib/gcc/x86_64-linux-gnu/4.3.2/include-fixed/usr/include 您还可能感兴趣的内容Eclipse + CDT + MinGW + MySQL环境搭建解决方案Debian 无缝升级Debian5至Debian6(不重装系统)Python调用Linux下的动态库(so)Eclipse SVN插件比较 Subclipse vs Subversive[原创]玩转Debian5——安装(LXDE桌面)]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1227.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>排序与查找函数(qsort,bsearch,alphasort)</title>
		<link>http://www.linuxany.com/archives/918.html</link>
		<comments>http://www.linuxany.com/archives/918.html#comments</comments>
		<pubDate>Sun, 27 Dec 2009 06:07:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[alphasort]]></category>
		<category><![CDATA[bsearch]]></category>
		<category><![CDATA[qsort]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=918</guid>
		<description><![CDATA[qsort函数声明如下： void qsort(void *base, size_t nmemb, size_t size, &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; int(*compar)(const&#160;void *, const void *)); 参数说明如下： base: 要排序的数组 nmemb: 数组中的元素数目 sizeof(array)/sizeof(array[0]) size: 每个数组元素占用内存空间，可使用sizeof(array[0])获得 compar: 比较两个数组元素的比较函数。本比较函数的第一个参数值小于、等于、大于第二参数值时，本比较函数的返回值应分别小于、等于、大于零。 bsearch函数声明如下： void *bsearch(const void *key, const void *base, size_t *nelem, size_t&#160;width, int(*fcmp)(const void *, const *)); 参数的意思和qsort的差不多，区别在于： 1. qsort用来排序，bsearch用二分法来查找元素 2. bsearch中的base必须是升序排列的数组 3. 如果数组里有重复的答案，则bsearch会返回其中一个的地址 [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/918.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>常用C自定义函数集</title>
		<link>http://www.linuxany.com/archives/914.html</link>
		<comments>http://www.linuxany.com/archives/914.html#comments</comments>
		<pubDate>Sat, 26 Dec 2009 15:32:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[StringFind]]></category>
		<category><![CDATA[StringReplace]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=914</guid>
		<description><![CDATA[//1.字符串大小写转换函数 char * ConversionString(char* _pDest, const char * _pSrc, int _nFlag); //2.将字符串转换为整数 int&#160;CharToInt(const char* _pStr); //3.将字符串转换成数字 double&#160;CharToDouble(const char* str); //4.将整型数字转换为字符串,(正负数都可以) char * IntToChar(char* pDestStr, int&#160;nSrcNum); //5.将浮点型数字转换为字符串,(正负数都可以) char * DoubleToChar(char* pDestStr, double&#160;dSrcNum); //6.将字符串形式表示的 IP 转换为一个整数 int&#160;CharToIp(const char* _pchIP); //7.将一个整数转换为一个IP字符串 char * IpToChar(const&#160;int nIP, char * _pchStrIP); //8.将字符串 pStr 中所有的 ch字符过滤掉 char * StringFilter(char * pStr, const&#160;char [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/914.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

