码迷,mamicode.com
首页 >  
搜索关键字:stdin    ( 2699个结果
Linux非阻塞IO(五)使用poll实现非阻塞的回射服务器客户端
前面几节我们讨论了非阻塞IO的基本概念、Buffer的设计以及非阻塞connect的实现,现在我们使用它们来完成客户端的编写。 我们在http://www.cnblogs.com/inevermore/p/4049165.html中提出过,客户端需要监听stdin、stdout和sockfd。 这里...
分类:系统相关   时间:2014-10-24 22:10:27    阅读次数:388
UVA - 10057 A mid-summer night's dream.
偶数时,中位数之间的数都是可以的(包括中位数) 奇数时,一定是中位数 推导请找初中老师 #include #include #include #include #include using namespace std; int box[1000000]; int main() { //freopen("in","r",stdin); //freopen...
分类:其他好文   时间:2014-10-24 11:03:24    阅读次数:240
Go语言下的文件读写操作
在Go语言中,文件是使用一个os.File类的对象指针表示的,也可以称这指针为文件句柄(filehandle),os.Stdin和os.Stdout也是属于这个*os.File类型的。 下面举例说明 package?main import?( ????"bufio" ??...
分类:编程语言   时间:2014-10-23 16:31:15    阅读次数:352
Linux下的非阻塞IO(一)
非阻塞IO是相对于传统的阻塞IO而言的。 我们首先需要搞清楚,什么是阻塞IO。APUE指出,系统调用分为两类,低速系统调用和其他,其中低速系统调用是可能会使进程永远阻塞的一类系统调用。但是与磁盘IO有关的系统调用是个例外。 我们以read和write为例,read函数读取stdin,如果是阻塞IO,...
分类:系统相关   时间:2014-10-23 12:11:41    阅读次数:259
Linux--基础篇--read,write原型
先上一段代码:这里用到的两个常量:STDIN_FILENO ,STDOUT_FILENO 定义在unidtd.h中 并且在该头文件中定义了很多系统服务的函数原型:如 read(),write();该程序从标准输入获得信息 并将信息输出到标准输出中
分类:系统相关   时间:2014-10-22 23:41:38    阅读次数:695
UVA - 10763-Foreign Exchange
就是A想去B去的地方,B想去A的地方就ok,给出很多人的需求,看OK不OK #include #include #include using namespace std; int main() { //freopen("in","r",stdin); int n; int a,b; multimapbox; multimap::iterato...
分类:其他好文   时间:2014-10-22 22:00:29    阅读次数:251
Algorithms 4th - 1.1 Basic Programming Model - CREATIVE PROBLEMS
欢迎交流 1.1.26public class TestApp { public static void main(String[] args) { int a = StdIn.readInt(); int b = StdIn.readInt(); ...
分类:其他好文   时间:2014-10-22 20:16:11    阅读次数:215
File Fragmentation
很弱的数据,随便搞 #include #include #include #include #include #include #include using namespace std; void debug() { cout<<"yes"<<endl; } int main() { //freopen("in","r",stdin); int T,...
分类:其他好文   时间:2014-10-22 14:38:15    阅读次数:174
python标准输入
备忘#! /usr/bin/python2.6 import sysfor line in sys.stdin: print line,
分类:编程语言   时间:2014-10-20 23:16:33    阅读次数:234
APUE读书笔记:File I/O
文件描述符:进程通过文件描述符来操作文件,文件描述符可以通过open, openat, creat系统调用返回;shell和其他应用默认打开标准输入(STDIN_FILENO),标准输出(STDOUT_FILENO),标准错误(STDERR_FILENO)三个文件描述符。open和openat函数:...
分类:其他好文   时间:2014-10-20 22:49:24    阅读次数:279
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!