Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Declaration | Functions
C++ Intermediate | Mobile-Friendly

bookDeclaration

For the cat, the function sound() declaration and call will look:

#include <iostream>
using namespace std;

// Function declaration
void sound() {
    cout << "meow!" << endl;
}

int main() {
    // Call the function to be executed 
    sound();

    return 0;
}

Remember:

  • you have to declare a function before calling it.
  • you can declare the function as many times as you want.

You have met functions at the beginning of your C++ programming path. main() - is the pre-defined function that is used to execute the code.

1. You have to...

2. Every program in c++ contains the function:

question mark

You have to...

Select the correct answer

question mark

Every program in c++ contains the function:

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 2

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Posez-moi des questions sur ce sujet

Résumer ce chapitre

Afficher des exemples du monde réel

Awesome!

Completion rate improved to 2.94

bookDeclaration

Glissez pour afficher le menu

For the cat, the function sound() declaration and call will look:

#include <iostream>
using namespace std;

// Function declaration
void sound() {
    cout << "meow!" << endl;
}

int main() {
    // Call the function to be executed 
    sound();

    return 0;
}

Remember:

  • you have to declare a function before calling it.
  • you can declare the function as many times as you want.

You have met functions at the beginning of your C++ programming path. main() - is the pre-defined function that is used to execute the code.

1. You have to...

2. Every program in c++ contains the function:

question mark

You have to...

Select the correct answer

question mark

Every program in c++ contains the function:

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 2
some-alt