Moreover, why long is not considered a data type?
long is a type.
See : Built-in types (C++)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In C double is considered a primary data type that can store floating-point numbers, but why double is also taken as a data type if it's the same as float?
Moreover, why long is not considered a data type?
If void means empty then why it's also considered as a data type?
Hi,
Since you're using C not C++, you'd better tell us which compiler you're using.
I don't see any difference in digits of the output results between double and float.
Check the sample:
#include <stdio.h>
int main() {
float floatValue = 3.1415926535897932384626433832795f;
double doubleValue = 3.1415926535897932384626433832795;
printf("Float: %.*f\n", 17, floatValue);
printf("Double: %.*lf\n", 17, doubleValue);
return 0;
}
The result :
and your example uses 1 instead of the more typical decimal
float a = 1.1f;
double b = 1.1;
For the second question, I don't understand what you are struggling with. Read the usage of void in C: The void type in C.
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.