libdo

Untitled

Oct 5th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. void esc_byt(char*end,int nl){
  4.    
  5. }
  6.  
  7. int main (){
  8.  
  9.     double db;
  10.     float ft;
  11.     int ui;
  12.     short us;
  13.     char uc;
  14.     int nl;
  15.  
  16.  
  17.     scanf("%f",&db);
  18.    
  19.     uc=us=ui=ft=db;
  20.     //se não der certo troca pelo tipo
  21.     esc_byt(&uc,sizeof(char));
  22.     esc_byt((char*)&us,sizeof(short));
  23.     esc_byt((char*)&ui,sizeof(int));
  24.     esc_byt((char*)&ft,sizeof(float));
  25.     esc_byt((char*)&db,sizeof(double));
  26.    
  27.     return 0;
  28.    
  29. }
Add Comment
Please, Sign In to add comment