Aller au contenu
Article Publié le

The Basics of a C++ Program

PDF 1 vue 0 téléchargement
Commentaires
Télécharger

Résumé

Basic Elements of C++

Lecture recommandée Cours alignement conventionnel Cours alignement conventionnel en PDF, plus de 30 000 cours électromécanique gratuit, exercices gratuit, rapports pfe, l... Electromécanique Lire The Basics of a C++ Program

A C++ program is a collection of one or more subprograms (functions)
Function
Collection of statements
Statements accomplish a task
Every C++ program has a function called main

Example Program
#include
using namespace std;
int main()
{
cout<<"Welcome to C++ Programming"<<endl;
return 0;
}

The Basics of a C++ Program
Programming language
a set of rules, symbols, special words
Rules
syntax – specifies legal instructions
Symbols
special symbols ( + - * ! … )
Word symbols
reserved words
(int, float, double, char …)

Identifiers
Rules for identifiers
must begin with letter or the underscore _
followed by any combination of numerals or letters
recommend meaningful identifiers
Evaluate the following
ElectricCharge
23Skidoo
snarFbLat

Arithmetic Operators and Operator Precedence
Common operators for calculations+ - * / %
Precedence same as in algebraic usage
Inside parentheses done first
Next * / % from left to right
Then + and - from left to right
Informations
Format
PDF
Domaine
Cours C/C++
Publié le
2 avr. 2022
Vues
1

Signaler un contenu

Connectez-vous pour signaler cette publication : les administrateurs doivent pouvoir vous répondre.

Commentaires (0)

Connectez-vous pour laisser un commentaire.

Soyez le premier à commenter

Partagez votre avis sur ce document — questions, retours ou votre propre expérience.

Ressources liées

Cours C/C++
Commentaires
Télécharger