hello
I had a question that what is the meaning of function in C++.
thank you

I ask that what is the meaning of switch in C++

in example:

#include <iostream>
#include <stdio.h>

void examplefunction(int a, int b, char c){
    switch (c){
        case '+': printf("%d + %d = %d\n", a,b,a+b); break;
        case '-': printf("%d - %d = %d\n", a,b,a-b); break;
        case '*': printf("%d * %d = %d\n", a,b,a*b); break;
        case '/': printf("%d / %d = %d\n", a,b,a/b); break;
        }
    }

int main() {
    examplefunction(9,3,'+');
    examplefunction(9,3,'-');
    examplefunction(9,3,'*');
    examplefunction(9,3,'/');
    return 0;
    }
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.