Advertisement
Jambix64

Casting01

Aug 2nd, 2016
3,580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5.  
  6.   struct dados{
  7.    int x = 16;
  8.    int y = 2;
  9.  
  10.    };
  11. int main(){
  12.  
  13.     dados ob;
  14.     float res = (float)ob.x /ob.y; // Usando casting
  15.  
  16.     wchar_t name = L'a';
  17.     cout<<res<<endl;
  18.  
  19.    cout<<(char)name<<endl;  // Usando casting
  20.  
  21.    system("pause");
  22.    return 0;
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement