cin EOF Linux
我为什么写这个题目呢,因为我今天要写的博与这三者都有关系,至少我个人认为是这样的。
有个人问了一个这样的小程序,说有问题:
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector <string*> spvec;
string str;
cout <<"input string" <<endl;
while(cin>>str)
{
//cin>>str;
string *pstr=new string;
*pstr=str;
spvec.push_back(pstr);
}
vector <string*>::iterator it=spvec.begin();
while(it != spvec.end())
{
cout <<**it <<" " <<(**it).size() <<endl;
++it;
}
it=spvec.begin();
while(it != spvec.end())
{
delete *it;
it++;
}
return 0;
}
这段程序我认为是没有问题的,我在VS2008下和ubuntu g++ 4.4.1下试过是没有问题的。想不明白那人是怎样的。我觉得是他在输入EOF时出了问题吧。 在Windows下用 Ctrl+Z , 在Linux下用 Ctrl+D .
我觉得就是他在Linux下输入出了问题。
相关文档:
1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI) 就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......
Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......
Linux 启动顺序:
1、 BIOS自检
2、 运行系统内核并检测硬件
3、 运行系统的第一个进程init
4、 init读取系统引导配置文件/etc/inittab中的信息进行初始化
/etc/rc.d/rc.sysinit------系统初始化脚本
  ......
typedef struct siginfo
{
int si_signo; /* Signal number.*/
&n ......
转自:http://www.neatstudio.com/show-365-1.shtml
在ubuntu下面默认是不能mount samba共享的目录的,而在公司里,我不得不连接这样的目录,在windows下面的时候,samba共享就象windows的共享目录那样的方便,但是在linux下面就不是这样的了。
首先,你要下载smbmount,运行 :
apt-get install smbfs
然后就会安 ......