0
Please explain me about the working of above code
I want to know about %ld and working of sizeof as well as about code given
12 ответов
+ 1
Post your code?
+ 1
#include <stdio.h>
int main() {
printf("int: %ld \n", sizeof(int));
printf("float: %ld \n", sizeof(float));
printf("double: %ld \n", sizeof(double));
printf("char: %ld \n", sizeof(char));
return 0;
}
+ 1
%d is use to print any integer. And sizeof function is used to know the size of any data type(in bytes) such as integer, float, character etc
0
Muhammad Faisal
sizeof has type long unsigned int so for this type we use %ld which represents long integer value
0
I'm sorry
I couldn't understand it...
0
Muhammad Faisal
You have to learn C course to understand.
0
How can I do that..
0
Muhammad Faisal
You don't know how to learn anything?
0
Thanks alot sir!
0
Thanks alot ma'am!
0
Why is the return type of the sizeof() function ld instead of d? I don't think that there would be any declared variable with a size that goes beyond int's storage capacity.