Note
Kailangan ng pahintulot para ma-access ang page na ito. Maaari mong subukang mag-sign in o magpalit ng mga direktoryo.
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang baguhin ang mga direktoryo.
When a function name declared in your program is used without parentheses, the compiler does not produce code. This occurs regardless of whether or not the function takes parameters because the compiler calculates the function address; however, because the function call operator "()" is not present, no call is made. This result is similar to the following:
// compile with /Wall to generate a warning
int a;
a; // no code generated here either
In Visual C++, even using warning level 4 generates no diagnostic output. No warning is issued; no code is produced.
The sample code below compiles (with a warning) and links correctly without errors but produces no code in reference to funcn( ). For this to work correctly, add the function call operator "()".
#include <stdio.h>
void funcn();
int main() {
funcn; /* missing function call operator;
call will fail. Use funcn() */
}
void funcn() {
printf("\nHello World\n");
}