<?xml version="1.0" encoding="GB2312"  ?>

			<rss version="2.0">

			<channel>

			<title>ChinaUnix.net - C/C++</title>

			<link>http://bbs.chinaunix.net/forumdisplay.php?fid=23</link>

			<description><![CDATA[C是世界上使用最广泛计算机语言。C的面向对象的扩展称为C++。]]></description>
			<managingEditor>admin2@staff.chinaunix.net</managingEditor>

			<webMaster>admin2@staff.chinaunix.net</webMaster>

			<lastBuildDate>2010-03-21 08:03:04</lastBuildDate>
<item>

				<title>copy to write </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679780</link>

  				<author>dutysmart</author>
  				<pubDate>2010-03-20 23:34:00</pubDate>
				<description><![CDATA[

				作者: dutysmart

				发表于: 2010-03-20 23:34:00 (GMT 8)

				简介：#include "stdio.h"
#include <unistd.h>

int a=1;

void main(void)
{
int b=1;
pid_t pid; 

if((pid=fork())<0){
printf("error\n");
}else if(pid==0){ 
a=2;
b=2;
printf("son &a=%x\n",&a);


				]]></description>

				</item>
<item>

				<title>谁能简单举例，说一下&quot;软流水优化&quot;是如何做的? 普通PC上运行的程序 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679767</link>

  				<author>jeanlove</author>
  				<pubDate>2010-03-20 22:50:50</pubDate>
				<description><![CDATA[

				作者: jeanlove

				发表于: 2010-03-20 22:50:50 (GMT 8)

				简介：我在网上搜了一下，好像谈到软流水优化的内容几乎都是针对DSP或者嵌入式编程的。

但是对于一般的在PC或者服务器上面跑的程序呢? 能否写出一个最简单的程序来说明一下这个概念?

谢谢

				]]></description>

				</item>
<item>

				<title>__noreturn__函数 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679763</link>

  				<author>koolcoy</author>
  				<pubDate>2010-03-20 22:35:54</pubDate>
				<description><![CDATA[

				作者: koolcoy

				发表于: 2010-03-20 22:35:54 (GMT 8)

				简介：如果在一个函数里调用了带有__noreturn__属性的函数，有办法让C＋＋自动析构栈上的对象吗？

				]]></description>

				</item>
<item>

				<title>一个算法题目 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679760</link>

  				<author>phy0077</author>
  				<pubDate>2010-03-20 22:22:00</pubDate>
				<description><![CDATA[

				作者: phy0077

				发表于: 2010-03-20 22:22:00 (GMT 8)

				简介：输入 a1, a2, ... , an, b1, b2, ... , bn, 如何在O(n)的时间，用O(1)的空间，将这个序列顺序改为 a1, b1, ...., an, bn.

据说是google的笔试题目，大家看看

				]]></description>

				</item>
<item>

				<title>[求助]C或C++拆字符串如何做到高速 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679745</link>

  				<author>abcbuzhiming</author>
  				<pubDate>2010-03-20 21:36:55</pubDate>
				<description><![CDATA[

				作者: abcbuzhiming

				发表于: 2010-03-20 21:36:55 (GMT 8)

				简介：现在有大量表示颜色的6位字符串，比如"FFFFFF"、"8C8C8C"、"7A7B7C"，他们的共同点都是6位，范围从"000000"-"FFFFFF",现在要求，把6位字符串拆分成3个2位字符串，并且将拆分得到的2位字符串强制转换为16进制数，再把该16进制数转换为10进制数，这样就等于把一串表示颜色的6位字符串拆分成了RED，GREEN，BLUE三原色分量。由于要转换的字符串太多，超过1000

				]]></description>

				</item>
<item>

				<title>大家帮忙看一下，execle，挑了一个小时了， </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679742</link>

  				<author>xdshting</author>
  				<pubDate>2010-03-20 21:15:34</pubDate>
				<description><![CDATA[

				作者: xdshting

				发表于: 2010-03-20 21:15:34 (GMT 8)

				简介：#include<stdio.h>
#include<stdlib.h>
#include<sys/wait.h>
#include<unistd.h>
char *env_init[]={"name=linpeng",(char *)0};

int main(int argc ,char **argv)
{
	pid_t	pid;
	
	if ((pid = fork())

				]]></description>

				</item>
<item>

				<title>某男在一个月里谈崩了18个女生, 句句经典 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679717</link>

  				<author>yanguangming15</author>
  				<pubDate>2010-03-20 19:24:32</pubDate>
				<description><![CDATA[

				作者: yanguangming15

				发表于: 2010-03-20 19:24:32 (GMT 8)

				简介：[i=s] 本帖最后由 yanguangming15 于 2010-03-20 19:29 编辑 [/i]

[font=宋体][size=3][color=#000000]1个月里谈崩了18个女生案例背景：最近一个月，奉父母之命，相续和女孩子交谈过，家里觉得我年龄大了，是到该谈一个朋友的时候了，然而我非常不孝顺，居然把这个过程弄得和人力资源主管考察新人一样。[/color][/size][/fo

				]]></description>

				</item>
<item>

				<title>这句话应该怎么理解？ </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679689</link>

  				<author>prolj</author>
  				<pubDate>2010-03-20 16:51:22</pubDate>
				<description><![CDATA[

				作者: prolj

				发表于: 2010-03-20 16:51:22 (GMT 8)

				简介：memory reference that does not trap

				]]></description>

				</item>
<item>

				<title>gdb如何看指向数组指针的内容 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679672</link>

  				<author>LaoLiulaoliu</author>
  				<pubDate>2010-03-20 16:17:22</pubDate>
				<description><![CDATA[

				作者: LaoLiulaoliu

				发表于: 2010-03-20 16:17:22 (GMT 8)

				简介：[i=s] 本帖最后由 LaoLiulaoliu 于 2010-03-20 16:34 编辑 [/i]

如题。
in a[5] = {1,2,3,4,5};
int *p = a;
用gdb调试时：
p p
$1 = (int *) 0x804a018
p *p
$2 = 1
print只能看到p指向地址的第一个int型的内容，如果要看其他的，必须p[1] p[2] p[3] 这

				]]></description>

				</item>
<item>

				<title>[C]计算一个字节(8位)里，1的个数，且高效率 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679668</link>

  				<author>feier7501</author>
  				<pubDate>2010-03-20 16:00:28</pubDate>
				<description><![CDATA[

				作者: feier7501

				发表于: 2010-03-20 16:00:28 (GMT 8)

				简介：计算一个字节(8位)里，1的个数，且高效率，除了循环，或者先做成一张表，算出来，有没有高效率的算法？

				]]></description>

				</item>
<item>

				<title>大家推荐一个用C++写的服务器，想学习前辈经验 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679661</link>

  				<author>chary8088</author>
  				<pubDate>2010-03-20 15:36:47</pubDate>
				<description><![CDATA[

				作者: chary8088

				发表于: 2010-03-20 15:36:47 (GMT 8)

				简介：很多服务器都是C写的，Apache，lighthttp等，
有没有C++写的服务器呢？？

				]]></description>

				</item>
<item>

				<title>c/c++ 还是我的问题？ </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679655</link>

  				<author>peidright</author>
  				<pubDate>2010-03-20 15:25:45</pubDate>
				<description><![CDATA[

				作者: peidright

				发表于: 2010-03-20 15:25:45 (GMT 8)

				简介：[i=s] 本帖最后由 peidright 于 2010-03-20 15:36 编辑 [/i]

感觉c的一个优点，但也是缺点，就是：写库的人太信任用户，但是用户确从来不信任库
或者这不是c的问题，而是人的问题，写c的是另外一种人。喜欢造轮子的人？

想看一些书，然后想拿一门语言写点代码实践一下书中的某个东西，发现我用c放个屁都要憋很久--
思维从数据结构，通信，内存管理，一点点展开。然

				]]></description>

				</item>
<item>

				<title>TCP中阻塞/非阻塞、同步/异步的关系？ </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679618</link>

  				<author>chenaiming2009</author>
  				<pubDate>2010-03-20 13:27:57</pubDate>
				<description><![CDATA[

				作者: chenaiming2009

				发表于: 2010-03-20 13:27:57 (GMT 8)

				简介：　　TCP中阻塞/非阻塞比较好理解，TCP默认是阻塞的，当一个操作得不到结果时，会导致操作阻塞在那儿。而将TCP设置为非阻塞后，当操作得不到结果时，程序并不阻塞，而以返回EWOULDBLOCK类似的错误。
　　对于同步/异步，不是具体了解，书上讲得也太清楚，只知道跟操作结果返回的实时性有关，请大家详解。另外，同步等同于阻塞吗？异步等同于非阻塞吗？
　　谢谢大家的指点！

				]]></description>

				</item>
<item>

				<title>关于TCP中发送确认与重新排序的问题 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679617</link>

  				<author>chenaiming2009</author>
  				<pubDate>2010-03-20 13:18:49</pubDate>
				<description><![CDATA[

				作者: chenaiming2009

				发表于: 2010-03-20 13:18:49 (GMT 8)

				简介：UNIX网络编程中说，
1、当TCP向另一端发送数据时，它要求对方返回一个确认。如果确认没有收到，TCP自动重传数据并等待更长的时间。在数次重传失败后，TCP才放弃。
2、TCP给所发送数据的每一个字节关联一个序列号进行排序。如果分节非顺序到达，接收方的TCP将根据它们的序列号重新排序。

我觉得在第1点能保证的情况下，为什么还引入第2点准则呢？假如现在有2个分节要发送，要么第1个分节成功

				]]></description>

				</item>
<item>

				<title>建立TCP连接后，如果对端不做接收操作，那最后发送方的send会怎样？ </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679605</link>

  				<author>chenaiming2009</author>
  				<pubDate>2010-03-20 12:40:02</pubDate>
				<description><![CDATA[

				作者: chenaiming2009

				发表于: 2010-03-20 12:40:02 (GMT 8)

				简介：　　结果验证：先通过getsockopt函数获取到TCP的发送和接收缓冲区大小都为8k。然后发送方循环每次发送8K的数据，对端并不做接收操作。当发送到第5次时，send函数阻塞。
　　按照我的理解，应该是第3次send时阻塞。即第1次的8K数据真正发送到了对端的TCP接收缓冲区，第2次的8K数据只是拷贝到了本端的TCP发送缓冲区而并没有发送出去，第3次才阻塞。为什么不是这样？？？
　　请教大家

				]]></description>

				</item>
<item>

				<title>MinGW 中能使用wmi 吗   。。。 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679604</link>

  				<author>evilmate</author>
  				<pubDate>2010-03-20 12:39:54</pubDate>
				<description><![CDATA[

				作者: evilmate

				发表于: 2010-03-20 12:39:54 (GMT 8)

				简介：RT          能吗  怎么使用

				]]></description>

				</item>
<item>

				<title>调用函数时传递参数的问题 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679602</link>

  				<author>chenaiming2009</author>
  				<pubDate>2010-03-20 12:33:54</pubDate>
				<description><![CDATA[

				作者: chenaiming2009

				发表于: 2010-03-20 12:33:54 (GMT 8)

				简介：简单的程序如下：
int TestFunc1(int v1, int v2)
{
	int i = v1;　// v1值为6
	int j = v2;　// v2值为5
	return 1;
}

typedef int (* TESTFUNC)(int v1, int v2, int v3);

int main(int argc, char **argv)
{
　TES

				]]></description>

				</item>
<item>

				<title>一个C++面试题的疑惑 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679588</link>

  				<author>shang2010</author>
  				<pubDate>2010-03-20 11:44:06</pubDate>
				<description><![CDATA[

				作者: shang2010

				发表于: 2010-03-20 11:44:06 (GMT 8)

				简介：下面的代码有什么问题?
class A 
{ 
public: 
A() { p=this; } 
~A() { if(p!=NULL) { delete p; p=NULL; } } 

A* p; 
};

为什么会有问题?不理解

				]]></description>

				</item>
<item>

				<title>请教一个在类中创建线程的问题 </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679573</link>

  				<author>@sky</author>
  				<pubDate>2010-03-20 11:16:23</pubDate>
				<description><![CDATA[

				作者: @sky

				发表于: 2010-03-20 11:16:23 (GMT 8)

				简介：[code]
[root@localhost cppwork]# cat tmp.cpp 
#include <iostream>

#include <pthread.h>

using namespace std;

class Thread {
        public:
                Thread();
                ~Thre

				]]></description>

				</item>
<item>

				<title>请问Linux有没有方法直接或者间接地用try-catch捕获SIGSEGV？ </title>

				<link>http://bbs.chinaunix.net/viewthread.php?tid=1679572</link>

  				<author>w_anthony</author>
  				<pubDate>2010-03-20 11:12:40</pubDate>
				<description><![CDATA[

				作者: w_anthony

				发表于: 2010-03-20 11:12:40 (GMT 8)

				简介：[code]#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <ucontext.h>

#ifndef BT
void Throw0()
{
	printf("Throw!\r\n");
	throw 0;
}
#endif

void Sig

				]]></description>

				</item>
</channel>
</rss>