-
-
Save TonyWhite/070e552314b63b74f7247529c2fd96e2 to your computer and use it in GitHub Desktop.
Enigma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Esterna::Esterna() | |
{ | |
numero = 0; | |
cout << "Classe dichiarata in .h e costruita in .cpp" << endl; | |
} | |
Esterna::~Esterna() | |
{ | |
cout << "Classe distrutta irrimediabilmente" << endl; | |
} | |
void Esterna::setNumero(int num) | |
{ | |
numero = num; | |
} | |
int Esterna::getNumero() | |
{ | |
return numero; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ESTERNA_H | |
#define ESTERNA_H | |
#include <iostream> | |
using std::cout; | |
using std::cin; | |
using std::endl; | |
using std::string; | |
class Esterna | |
{ | |
int numero; | |
public: | |
//Constructor | |
Esterna(); | |
//Destructor | |
virtual ~Esterna(); | |
//Set things | |
void setNumero(int num); | |
//Get things | |
int getNumero(); | |
}; | |
#include "esterna.cpp" | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "esterna.h" | |
int main() | |
{ | |
Esterna esterna; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
g++ -o main main.cpp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
main.cpp
esterna.h
Domanda
Questo previene il caricamento multiplo del sorgente in runtime?