Hey Leute ich überlege gerade welche der beiden Casting-Methoden besser ist.
C# oder die C++ möglichkeit. Habt ihr Erfahrungen?
c#:
C# oder die C++ möglichkeit. Habt ihr Erfahrungen?
c#:
C++Quote:
#include <iostream>
using namespace std;
int main ()
{
int A = 10 ;
float Faktor = 2.5 ;
int B = 0 ;
B = (int) ( A * Faktor );
cout << "B: " << Faktor << endl;
return 0;
}
Quote:
#include <iostream>
using namespace std;
int main ()
{
int A = 10 ;
float Faktor = 2.5 ;
int B = 0 ;
B = static_cast<int> (A*Faktor);
cout << "B: " << B << endl;
return 0;
}