|
-
October 8th, 2003, 08:56 AM
#1
casting problem
How do I cast a char* into a structure?
I mean that I have for example the following structure
struct myStruct
{
char sFirstParam[6];
char sSecondParam[8];
char sThirdParam[4];
char sForthParam[2];
};
and I need a char* holding the string "12345612345678123412"
I need sFirstParam to hold the first 6 chars 123456
I need sSecondParam to hold the first 6 chars 12345678
I need sThirdParam to hold the first 6 chars 1234
I need sForthParam to hold the first 6 chars 12
How do I do it without copying (memcpy for example)
I need to do it by casting
any idea how?
really thanks
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
|