Answers for "how to call a function inside a function c++"

C++
1

c++ functions inside functions

int main() {
    // This declares a lambda, which can be called just like a function
    auto print_message = [](std::string message) 
    { 
        std::cout << message << "n"; 
    };

    // Prints "Hello!" 10 times
    for(int i = 0; i < 10; i++) {
        print_message("Hello!"); 
    }
}
Posted by: Guest on September-04-2021

Code answers related to "how to call a function inside a function c++"

Browse Popular Code Answers by Language