我的程序问题很小。我不知道为什么当你启动程序时弹出Segmentation fault (core dumped)
我的client.c代码
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ipc.h>
#include <stdlib.h>
#include <string.h>
#define receiveKey 21
#define sendKey 11
int main(int argc, char *argv[])
{
char msg[512];
strcpy(msg, argv[1]);
key_t key;
key=ftok("/Downloads/zad6", getpid());
int senQueue=msgget(sendKey,0777);
int recQueue=msgget(receiveKey,0777);
msgsnd(senQueue,&msg,strlen(msg),0);
msgrcv(recQueue,&msg,sizeof(msg),0,0);
printf("Translate result: %s\n", msg);
return 0; }