//
// main.cpp
// cpplearn1
//
// Created by myhaspl on 2017/12/3.
// Copyright © 2017年 myhaspl@myhaspl.com. All rights reserved.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
int x=1;
int y=2.8;
int z1=static_cast<double>(x);
int z2=static_cast<int>(y);
auto v=12.111;
cout<<v<<endl;
cout<<z1<<endl;
cout<<z2<<endl;
return 0;
}
12.111
1
2
Program ended with exit code: 0