Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Simple Function Creation | Introduction
C++ Functions

book
Simple Function Creation

Taak

Swipe to start coding

Your task is to create a function and call this function in the main() function:

  • Create function signature:
    • specify std::string return type;
    • specify helloWorld as the name of the function
  • Return string "Hello World".
  • Call the function using its name.

Oplossing

cpp

solution

#include <iostream>

std::string helloWorld()
{
return "Hello World!";
}

int main()
{
std::cout << helloWorld();
}

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 3
#include <iostream>

___ ___()
{
___ "Hello World!";
}

int main()
{
std::cout << ___();
}

Vraag AI

expand
ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt