Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdint.h>
- #include <stdio.h>
- typedef void ( any_func )( void );
- typedef uint32_t ( u32_func )( uint32_t a );
- typedef uint64_t ( u64_func )( uint64_t a );
- uint32_t imp_u32_func(
- uint32_t a
- ){
- return( a );
- }
- uint64_t imp_u64_func(
- uint64_t a
- ){
- return( a );
- }
- u32_func* ptr_u32_func = (u32_func*)(any_func*)&( imp_u64_func );
- u64_func* ptr_u64_func = (u64_func*)(any_func*)&( imp_u32_func );
- int main( void ){
- printf("[hello_world]\n");
- uint64_t big =( 0xFFFFFFFFFFFFFFFF );
- uint32_t lit =( 0xFFFFFFFF );
- uint64_t v64 ;
- uint32_t v32 ;
- uint64_t v64_too ;
- v64 =( ptr_u64_func( big ) );
- v32 =( ptr_u32_func( lit ) );
- v64_too=( ptr_u64_func( big ) );
- printf( "[big]:::::%llu\n", big );
- printf( "[lit]:::::%u\n" , lit );
- printf( "[v64]:::::%llu\n", v64 );
- printf( "[v32]:::::%u\n" , v32 );
- printf( "[v64_too]:%llu\n", v64_too );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement