diff --git a/README.md b/README.md index 16eff96..53debf1 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,2 @@ -**Edit a file, create a new file, and clone from Bitbucket in under 2 minutes** +gdp tuto : https://u.osu.edu/cstutorials/2018/09/28/how-to-debug-c-program-using-gdb-in-6-simple-steps/ -When you're done, you can delete the content in this README and update the file with details for others getting started with your repository. - -*We recommend that you open this README in another tab as you perform the tasks below. You can [watch our video](https://youtu.be/0ocf7u76WSo) for a full demo of all the steps in this tutorial. Open the video in a new tab to avoid leaving Bitbucket.* - ---- - -## Edit a file - -You’ll start by editing this README file to learn how to edit a file in Bitbucket. - -1. Click **Source** on the left side. -2. Click the README.md link from the list of files. -3. Click the **Edit** button. -4. Delete the following text: *Delete this line to make a change to the README from Bitbucket.* -5. After making your change, click **Commit** and then **Commit** again in the dialog. The commit page will open and you’ll see the change you just made. -6. Go back to the **Source** page. - ---- - -## Create a file - -Next, you’ll add a new file to this repository. - -1. Click the **New file** button at the top of the **Source** page. -2. Give the file a filename of **contributors.txt**. -3. Enter your name in the empty file space. -4. Click **Commit** and then **Commit** again in the dialog. -5. Go back to the **Source** page. - -Before you move on, go ahead and explore the repository. You've already seen the **Source** page, but check out the **Commits**, **Branches**, and **Settings** pages. - ---- - -## Clone a repository - -Use these steps to clone from SourceTree, our client for using the repository command-line free. Cloning allows you to work on your files locally. If you don't yet have SourceTree, [download and install first](https://www.sourcetreeapp.com/). If you prefer to clone from the command line, see [Clone a repository](https://confluence.atlassian.com/x/4whODQ). - -1. You’ll see the clone button under the **Source** heading. Click that button. -2. Now click **Check out in SourceTree**. You may need to create a SourceTree account or log in. -3. When you see the **Clone New** dialog in SourceTree, update the destination path and name if you’d like to and then click **Clone**. -4. Open the directory you just created to see your repository’s files. - -Now that you're more familiar with your Bitbucket repository, go ahead and add a new file locally. You can [push your change back to Bitbucket with SourceTree](https://confluence.atlassian.com/x/iqyBMg), or you can [add, commit,](https://confluence.atlassian.com/x/8QhODQ) and [push from the command line](https://confluence.atlassian.com/x/NQ0zDQ). \ No newline at end of file diff --git a/d00/ex01/Contact.class.cpp b/d00/ex01/Contact.class.cpp new file mode 100644 index 0000000..7944e30 --- /dev/null +++ b/d00/ex01/Contact.class.cpp @@ -0,0 +1,53 @@ +#include "Contact.class.hpp" +#include +#include + +Contact::Contact( void ) { + + return; + +} + +Contact::~Contact( void ) { + + return; + +} + +void Contact::add_index( std::string str ) { + + this->index.assign(str); + return; + +} + +void Contact::add_first( std::string str ) { + + this->first.assign(str); + return; + +} + +void Contact::add_last( std::string str ) { + + this->last.assign(str); + return; + +} + +void Contact::add_nick( std::string str ) { + + this->nick.assign(str); + return; + +} + +void Contact::print_contact( void ) { + + std::cout << "INDEX : " << this->index << std::endl; + std::cout << "FIRST NAME : " << this->first << std::endl; + std::cout << "LAST NAME : " << this->last << std::endl; + std::cout << "NICKNAME : " << this->nick << std::endl; + return; + +} diff --git a/d00/ex01/Contact.class.hpp b/d00/ex01/Contact.class.hpp new file mode 100644 index 0000000..4e2b9c6 --- /dev/null +++ b/d00/ex01/Contact.class.hpp @@ -0,0 +1,22 @@ +#ifndef CONTACT_CLASS_HPP +# define CONTACT_CLASS_HPP + +#include + +class Contact { + public: + Contact(); + ~Contact(); + std::string index; + std::string first; + std::string last; + std::string nick; + void add_index(std::string str); + void add_first(std::string str); + void add_last (std::string str); + void add_nick (std::string str); + void print_contact(); +}; + +#endif + diff --git a/d00/ex01/Makefile b/d00/ex01/Makefile index 6456ed4..f2b051c 100644 --- a/d00/ex01/Makefile +++ b/d00/ex01/Makefile @@ -16,11 +16,11 @@ LIBS = INCLUDES = -I$(D_HEADERS) D_HEADERS = . -HEADERS = Phonebook.class.hpp \ - Phonebook.class.cpp +HEADERS = PhoneBook.class.hpp \ + PhoneBook.class.cpp D_SRCS = . -SRCS = Phonebook.cpp \ +SRCS = main.cpp \ D_OBJS = builds OBJS = $(SRCS:%.cpp=$(D_OBJS)/%.o) diff --git a/d00/ex01/PhoneBook.class.cpp b/d00/ex01/PhoneBook.class.cpp new file mode 100644 index 0000000..13f5cc4 --- /dev/null +++ b/d00/ex01/PhoneBook.class.cpp @@ -0,0 +1,16 @@ +//#include +//#include +#include +#include "PhoneBook.class.hpp" + +PhoneBook::PhoneBook( void ) { + + return; + +} + +PhoneBook::~PhoneBook( void ) { + + return; + +} diff --git a/d00/ex01/PhoneBook.class.hpp b/d00/ex01/PhoneBook.class.hpp new file mode 100644 index 0000000..166b1c2 --- /dev/null +++ b/d00/ex01/PhoneBook.class.hpp @@ -0,0 +1,12 @@ +#ifndef PHONEBOOK_CLASS_HPP +# define PHONEBOOK_CLASS_HPP +#include "Contact.class.cpp" + +class PhoneBook { + public: + PhoneBook(); + ~PhoneBook(); + Contact contact; +}; + +#endif diff --git a/d00/ex01/Phonebook.class.cpp b/d00/ex01/Phonebook.class.cpp deleted file mode 100644 index e88b890..0000000 --- a/d00/ex01/Phonebook.class.cpp +++ /dev/null @@ -1,18 +0,0 @@ -//#include -//#include -#include -#include "Phonebook.class.hpp" - -Phonebook::Phonebook( void ) { - - std::cout << "hello" << std::endl; - return; - -} - -Phonebook::~Phonebook( void ) { - - std::cout << "good bye" << std::endl; - return; - -} diff --git a/d00/ex01/Phonebook.class.hpp b/d00/ex01/Phonebook.class.hpp deleted file mode 100644 index d5a5962..0000000 --- a/d00/ex01/Phonebook.class.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef PHONEBOOK_CLASS_HPP -# define PHONEBOOK_CLASS_HPP - -class Phonebook { - public: - Phonebook(); - ~Phonebook(); -}; - -#endif diff --git a/d00/ex01/Phonebook.cpp b/d00/ex01/Phonebook.cpp deleted file mode 100644 index 9defe88..0000000 --- a/d00/ex01/Phonebook.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Phonebook.class.cpp" - -int main() { - - Phonebook yellow; - - return 0; -} diff --git a/d00/ex01/builds/PhoneBook.o b/d00/ex01/builds/PhoneBook.o new file mode 100644 index 0000000..1633f08 Binary files /dev/null and b/d00/ex01/builds/PhoneBook.o differ diff --git a/d00/ex01/builds/main.o b/d00/ex01/builds/main.o new file mode 100644 index 0000000..552f348 Binary files /dev/null and b/d00/ex01/builds/main.o differ diff --git a/d00/ex01/main.cpp b/d00/ex01/main.cpp new file mode 100644 index 0000000..ab32f1e --- /dev/null +++ b/d00/ex01/main.cpp @@ -0,0 +1,10 @@ +#include "PhoneBook.class.cpp" +#include + +int main() { + + PhoneBook yellow; + yellow.contact.add_first("hugo"); + yellow.contact.print_contact(); + return 0; +} diff --git a/d00/ex01/phonebook b/d00/ex01/phonebook new file mode 100755 index 0000000..bb3932e Binary files /dev/null and b/d00/ex01/phonebook differ diff --git a/d00/megaphone.cpp b/d00/megaphone.cpp deleted file mode 100644 index 1af6a50..0000000 --- a/d00/megaphone.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include - -int main(int ac, char **av) -{ - if (ac < 2) - std::cout << std::uppercase << "shhhhh... I think the students are asleep..."; - else - for (int i = 1; av[i] != NULL; i++) - for (int j = 0; av[i][j] != '\0'; j++) - std::cout << (char)toupper(av[i][j]); - std::cout << std::endl; - return 0; -}