Passing array of characters help

Joined
Sep 17, 2006
Messages
3
Reaction score
0
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
                }
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top