我需要生成键,在我的应用程序中的一些字段,所以我只是把他们转换为int和调用ftok,但它不工作,我不知道为什么。by app, basicly it just convert a few fields into unique int for example 3001if((key = ftok", proj_id)) < 0); perror("ftok");}但我经常遇到这个问题。
; /* shared array of strings for consumers */Main:(将fork()“生产者”和“消费者”进程)
/* Use ftok() to get a value for a key to identify a* Attach shared memory segment to the parent process *