The sizeof function (sometimes called an operator) is used to calculate the size of a given argument. If some other function is given as argument, then the function will not be executed in sizeof.
In the following example, we will place a printf() statement inside a loop. Then we will see the output.
#include<stdio.h> double my_function() { printf("This is a test function"); return 123456789; } main() { int x; x = sizeof(printf("Hello World")); printf("The size: %d</p><p>", x); x = sizeof(my_function()); printf("The size: %d", x); }
The size: 4 The size: 8
In sizeof(), printf() will not be executed, only the return type will be considered and its size will be taken.
The above is the detailed content of In C language, anything written in sizeof() will not be executed. For more information, please follow other related articles on the PHP Chinese website!