Casting Long (GCC)

long long x; double n; x=long long(n); 

This does not work. What is the right way?

+4
source share
3 answers

In any simple C / C ++ compiler, in order to make a throw, you should use myvar "parentheses (mytype), maybe you got confused because you needed 2 separate words ...

0
source

The obvious:

 x = (long long) n; 
+5
source

C has no constructors; it looks like a call to the C ++ constructor.

In C, actor syntax is the type name in parentheses. It works like a prefix operator, changing the type of an expression to the right:

 long long x = (long long) 3.14; 
+2
source

All Articles