Chinaunix首页 | 论坛 | 博客
  • 博客访问: 157670
  • 博文数量: 76
  • 博客积分: 1513
  • 博客等级: 上尉
  • 技术积分: 755
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-25 15:15
文章分类

全部博文(76)

文章存档

2012年(2)

2011年(74)

我的朋友

分类: C/C++

2011-11-25 20:58:09

  1. /*

  2.  * main.cpp

  3.  *

  4.  * Created on: Jun 10, 2011

  5.  * Author: xq

  6.  */

  7.  

  8. #include<iostream>

  9. #include<unistd.h>

  10. #include<sys/types.h>

  11. #include<signal.h>

  12. using namespace std;

  13.  

  14. int main()

  15. {

  16. pid_t pid;

  17. pid=getpid();

  18. cout<<"hello"<<endl;

  19. kill(pid,9);//pid is the id of process to be killed;9 denote the type of signal

  20. //transmit to the to_be_killed process

  21. cout<<"hi"<<endl;

  22. return 0;

  23. }

output:

hello


阅读(355) | 评论(0) | 转发(0) |
0

上一篇:进程示例

下一篇:big endian&little endian test

给主人留下些什么吧!~~