From ab4200c63a1b9e7c89b955b250817d32b0ed3821 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 16 Mar 2016 13:15:13 +0100 Subject: [PATCH] Test classe --- Makefile | 2 +- src/main.cpp | 5 ++++- src/testClasse.cpp | 9 +++++++++ src/testClasse.hpp | 8 ++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/testClasse.cpp create mode 100644 src/testClasse.hpp diff --git a/Makefile b/Makefile index 09eaed7..568041b 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ CXX = g++ main: bin/main # Éxecutables -bin/main: obj/main.o +bin/main: obj/main.o obj/test.o obj/testClasse.o $(CXX) $^ -o $@ $(CXXFLAGS) # Objets diff --git a/src/main.cpp b/src/main.cpp index a403032..49be484 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,11 @@ /* Programme principal */ #include "test.hpp" +#include "testClasse.hpp" int main() { - helloWorld(4); + Geoffrey frogeye; + frogeye.setN(42); + helloWorld(frogeye.getN()); return 0; } diff --git a/src/testClasse.cpp b/src/testClasse.cpp new file mode 100644 index 0000000..4b1cfa5 --- /dev/null +++ b/src/testClasse.cpp @@ -0,0 +1,9 @@ +#include "testClasse.hpp" + +int Geoffrey::getN() { + return m_n; +} + +void Geoffrey::setN(int n) { + m_n = n; +} diff --git a/src/testClasse.hpp b/src/testClasse.hpp new file mode 100644 index 0000000..9644b32 --- /dev/null +++ b/src/testClasse.hpp @@ -0,0 +1,8 @@ +class Geoffrey { + private: + int m_n; + + public: + int getN(); + void setN(int n); +}; -- libgit2 0.21.2