GDay everyone,
I have a problem that I spent so much time on it.
How can I fix my code(below) to output the buffer msg_cat in function A from function B ?
Please help if you're interested in.
I'd appreciate it.
Code:void A(){ char *msg; char msg_cat[100] = ""; //Receive multicasted messages from server and store in msg buffer. msg = (char *)recvfromDST (&read_EP, sockMulti); //Concatenate message msg into buffer msg_cat. strcat(msg_cat, msg); strcat(msg_cat, "\n"); } void B(){ if (strncmp(KB_buff, "display", 7) == 0){ //output to screen here } }