码迷,mamicode.com
首页 > 其他好文 > 详细

APUE_1.6PrintTheProcessID

时间:2015-02-11 09:14:44      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:

 1 /*
 2  * 1.6PrintTheProcessID.cpp
 3  *
 4  *  Created on: Feb 11, 2015
 5  *      Author: sunyj
 6  */
 7 
 8 #include "../apuesunyj.h"
 9 
10 int main(void)
11 {
12     printf("hello world from process ID %ld\n", static_cast<long>(getpid()));
13     return 0;
14 }
 1 // apuesunyj.h
 2 #ifndef APUE_SUNYJ
 3 #define APUE_SUNYJ
 4 
 5 #include <errno.h>
 6 #include <stdio.h>
 7 #include <string.h>
 8 #include <stdarg.h>
 9 #include <stdlib.h>
10 #include <stdint.h>
11 #include <unistd.h>
12 
13 void err_quit(const char *fmt, ...);
14 void err_sys(const char *fmt, ...);
15 
16 
17 #endif

技术分享

技术分享

APUE_1.6PrintTheProcessID

标签:

原文地址:http://www.cnblogs.com/sunyongjie1984/p/4285255.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!