Skip to content
Snippets Groups Projects
Commit 25715f55 authored by frederic gruau's avatar frederic gruau
Browse files

deux procedures simples pour tester l'effet du & pour passer des references.

parent 40c75c47
No related branches found
No related tags found
No related merge requests found
//============================================================================
// Name : testCpp.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
void increment(int &n) {
n=n+1;
}
int main() {
int a = 5;
increment(a);
cout << a << endl;
}
//============================================================================
// Name : testCpp.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
void increment(int n) {
n=n+1;
}
int main() {
int a = 5;
increment(a);
cout << a << endl;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment