Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define size1 16
- int main(){
- unsigned char c[size1] = {0};
- unsigned int a = 858927408, b = 97; // 97 == 'a'; 858927408 == "0123"
- *((unsigned int*)c) = a;
- *((unsigned int*)c+1) = b;
- printf("c = '%s'\n", c);
- for(int i = 0; i < size1; ++i){
- printf("%3x ", c[i]);
- }
- printf("\n");
- for(int i = 0; i < size1; ++i){
- printf("%3d ", c[i]);
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement