diff --git a/C++/42_cppBeginners.cpp b/C++/42_cppBeginners.cpp new file mode 100644 index 0000000..043548e --- /dev/null +++ b/C++/42_cppBeginners.cpp @@ -0,0 +1,38 @@ +//This is Sally.h file +#ifndef SALLY_H +#define SALLY_H + +class Sally +{ + public: + Sally(); + void printCrap(); + protected: + private: +}; +#endif // SALLY_H + +//This is Sally.cpp file +#include "Sally.h" +#include +using namespace std; + +Sally::Sally() +{ +} +void Sally::printCrap(){ + cout<< "did someone say steak?"< +#include "Sally.h" +using namespace std; + +int main(){ + Sally sallyObject; + Sally *sallyPointer = &sallyObject; + + sallyObject.printCrap(); + sallyPointer->printCrap(); +} \ No newline at end of file diff --git a/C++/43_cppBeginners.cpp b/C++/43_cppBeginners.cpp new file mode 100644 index 0000000..f2f8c4b --- /dev/null +++ b/C++/43_cppBeginners.cpp @@ -0,0 +1,39 @@ +//This is Sally.h file +#ifndef SALLY_H +#define SALLY_H + +class Sally +{ + public: + Sally(); + ~Sally(); + protected: + private: +}; +#endif // SALLY_H + +//This is Sally.cpp file +#include "Sally.h" +#include +using namespace std; + +Sally::Sally() +{ + cout<< "i am the constructor" << endl; +} + +Sally::~Sally() +{ + cout<< "i am the deconstructor" << endl; +} + +//This is main.cpp file +#include +#include "Sally.h" +using namespace std; + +int main(){ + + Sally so; + cout << "omg wtf is this on my shoe? "<