|
-
January 9th, 2002, 11:48 AM
#1
Assigna string to a char buffer[]
I have the following code
char buffer [100];
struct sendMsg {
char func_id[20];
int data;
} send_msg;
....
...
int paramsignal=12;
sprintf(buffer,"%s 0 0 0 0 %d", "Sin", paramsignal);
How can I assign the containing of the struct member send_msg.func_id to be located in the buffer placed in the sprintf instead of the string "Sin"?
I have to use the sprintf function in my source code application.
Is this correct
sprintf(buffer,"%s 0 0 0 0 %d",send_msg.func_id, paramsignal);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|