In JavaScript you can call a function if a certain Boolean variable is true:
booleanVariable && functionToExecute();
Is it possible to do the same thing in C?
Thank you
Yes, you can:
#include <stdio.h>
int functionToExecute()
{
printf("ran function");
return 1;
}
int main()
{
int booleanVariable = 1;
booleanVariable && functionToExecute();
return 0;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.