Static cast test.
This commit is contained in:
parent
f3a5a7668a
commit
423e3e342b
15
main.cpp
15
main.cpp
@ -1,13 +1,12 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
void print(int x)
|
||||||
|
{
|
||||||
|
std::cout << x;
|
||||||
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
if(-1)
|
print(static_cast<int>(5.5F));
|
||||||
std::cout << "-1 is true\n";
|
return 0;
|
||||||
if(2)
|
|
||||||
std::cout << "2 is true\n";
|
|
||||||
if(1)
|
|
||||||
std::cout << "1 is true\n";
|
|
||||||
if(!0)
|
|
||||||
std::cout << "0 is false\n";
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user