msgctl.cc

来自「达内IT培训Unix C++第三天源码 是入门Unix 下C++编程的好东西」· CC 代码 · 共 22 行

CC
22
字号
#include <iostream>using namespace std;#include <sys/types.h>#include <sys/ipc.h>#include <sys/msg.h>int main(){	int key;	cout << "input key:";	cin >> hex >> key;	int qid = msgget(key, 0);	cout << "qid=" << qid << endl;	if(qid<0)		cout << "not found!" << endl;	else if(msgctl(qid,IPC_RMID,NULL)<0)		cout << "error!" << endl;	else		cout << "OK!" << endl;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?