Is it possible to put a function inside an if-else statement?

if (condition)
{
   // function here
}
else 
{
   // function here
}

Recommended Answers

All 3 Replies

Do you mean calling a function or defining a function.

I meant calling a function

Of course.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.