1234567891011121314151617181920212223242526272829
typedef struct { long mtype; char mtext[4096]; } mymsg_t; static int queueid; //parent process sends to queue child process receives from queue int main() { int size = 0; int maxsize = 4096; char boof[4096]; fstream filestr; filestr.open("testfile4k.txt", fstream::in); while(filestr>>boof[size] && size < maxsize) { size++; } filestr.close(); cout<<size<<endl; int msgqid; mymsg_t *mymsg; int len = 4096; struct timeval tv; time_t curtime; char buffer[4096]; memcpy(mymsg->mtext, boof, maxsize);