Results 1 to 3 of 3
Hi everyone,
I am a dummy in C programming. I have a problem with copying the array of 64 elements of unsigned char to array of 8 element of uint64_t. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-17-2010 #1Just Joined!
- Join Date
- Sep 2010
- Posts
- 14
need help in Copying unsigned char to uint64_t
Hi everyone,
I am a dummy in C programming. I have a problem with copying the array of 64 elements of unsigned char to array of 8 element of uint64_t. For example:
unsigned char p[64]
uint64_t Data[8];
memcpy (&Data, &p, 64);
I am not sure if it is right. Please help me. Thanks a lot.
Moreover, do both p and Data have 64 bytes?
- 10-17-2010 #2Just Joined!
- Join Date
- Sep 2010
- Posts
- 14
one more question is how to copy an uint64_t variable to uint64_t array of 8 elements. Thank you so much. I am looking forward to your reply
- 10-20-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,156
Why do you want to do this? What is the purpose of the operation? In any case, yes you can do a memcpy() operation as you showed, but that may or may not be what you want to do. Hence, the reason for my first 2 questions.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
