0
I dont understand why I should use the diferend types int double and float and not juast one general
3 Réponses
+ 7
For performance reasons. When you declare a variable, e.i. int Variable, the compiler puts aside memory for that variable and what it will store. Now the amount of memory put aside is dependant on the declaration. A char uses less memory that an int, an int uses less memory than a float, and a float uses less memory than a double. So if you're going to have single digit number, no decimal value to it, would it really make sense to declare it a double and put aside extra memory you dont need. Or would it make more sense to just use the memory you need and declare it an int.
0
just for allocation of memory
0
good....really good answer
I like it