TP0: added part 1, version 2

This commit is contained in:
Yohan Boujon 2021-12-18 14:55:59 +01:00
parent fa69f35b4c
commit 8901343e9b
2 changed files with 79 additions and 0 deletions

36
tp0/p1v2/main.cpp Executable file
View file

@ -0,0 +1,36 @@
#include <iostream>
using namespace std;
void remplitA(int tab[]);
void afficheA(int tab[]);
int main()
{
int a[10];
const int *pointA7 = &a[7];
remplitA(a);
cout << "pointA7 =" << *pointA7 << endl;
pointA7 ++;
cout << "pointA7 =" << *pointA7 << endl;
afficheA(a);
return 0;
}
void remplitA(int tab[])
{
for(int i=0 ; i<10 ; i++)
{
cout << "A [" << i << "] :";
cin >> tab[i];
};
};
void afficheA(int tab[])
{
cout << "Valeurs de A :" << endl;
for(int i=0 ; i<10 ; i++)
{
cout << tab[i] << ", ";
}
cout << endl;
};

43
tp0/p1v2/p1v2.cbp Executable file
View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="p1v2" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/p1v2" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/p1v2" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>