answersLogoWhite

0

Yes, you can call a function from within a switch statement in C.

switch (i) {

case 0: function1(i); break;

case 1: function2(i); break;

default: function3(i); break;

}

When the function returns, you will still be in the switch statement.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Who is calling main function in c?

in c main function initailly called by operating system.


When calling a function that has multiple parameters can you list the arguments in any order?

No. C function argument are positional.


What is the function of visual c plus plus switch condition?

The switch / case statement.


How do you add two numbers with out using operator in c language?

Not possible. Of course you can call a function which does the addition for you, but function-calling is also an operator in C.


How switch function differs from user defined functions in C?

. please give me 3 or 4 differences.one difference is that user defined can be called anytime but not for switch There is no such thing as 'switch function'


What is the meaning of x.getdata in c plus?

it mens u r calling de member function of de program


Why you use void res in c programming?

since, the word 'void' in C programming language means that it does not return any value to the user or calling function....this is usually used to specify a type of function...... for this reason w use 'void'in c program..


How are input and output functions are accessed in C programming?

The most common way to invoke an input/output function is calling it by its name. Example with function puts:puts ("Hello world");


What is the function of changeover switch?

Function Of Change Over Switch


What does c l mean on the back of a light switch?

The "C" and "L" markings on the back of a light switch typically stand for "Common" and "Load," respectively. The "C" terminal is where the power supply connects, while the "L" terminal connects to the light fixture or load that the switch controls. Properly connecting these terminals is crucial for the switch to function correctly in controlling the light.


What is calling by reference?

In C++ (C Plus Plus), when you call by reference, you are directly accessing the data of the referenced object. When you pass an object to a function by reference, any and all alterations to the object made within the function carry through to the actual object.


What is the function of a switch?

The function of a switch is to break and connect the flow of electricity.