Exercice 1
This commit is contained in:
parent
ad026db6e2
commit
82d031976d
1 changed files with 24 additions and 0 deletions
24
src/etape1/Mon_nom.cpp
Normal file
24
src/etape1/Mon_nom.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include <iostream>
|
||||
|
||||
void maj1(int& j);
|
||||
void maj2(int* j);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int i(2);
|
||||
maj1(i);
|
||||
std::cout << i << std::endl;
|
||||
maj2(&i);
|
||||
std::cout << i <<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void maj1(int& j)
|
||||
{
|
||||
j *= 2;
|
||||
}
|
||||
|
||||
void maj2(int* j)
|
||||
{
|
||||
(*j) *= 2;
|
||||
}
|
Loading…
Add table
Reference in a new issue