Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions C++/42_cppBeginners.cpp
Original file line number Diff line number Diff line change
@@ -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 <iostream>
using namespace std;

Sally::Sally()
{
}
void Sally::printCrap(){
cout<< "did someone say steak?"<<endl;
}

//This is main cpp.
#include <iostream>
#include "Sally.h"
using namespace std;

int main(){
Sally sallyObject;
Sally *sallyPointer = &sallyObject;

sallyObject.printCrap();
sallyPointer->printCrap();
}
39 changes: 39 additions & 0 deletions C++/43_cppBeginners.cpp
Original file line number Diff line number Diff line change
@@ -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 <iostream>
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 <iostream>
#include "Sally.h"
using namespace std;

int main(){

Sally so;
cout << "omg wtf is this on my shoe? "<<endl;
}