Created
May 22, 2012 02:51
-
-
Save Chavao/2766233 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <iostream> | |
#include "rumo.h" | |
using namespace std; | |
int main() | |
{ | |
Rumo r; | |
// Definindo um valor qualquer para "Rumo" | |
r.setValor(70); | |
cout << "Valor: " << r.obterValor() << endl; | |
return 0; | |
} |
This file contains hidden or 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 <iostream> | |
#include "rumo.h" | |
int Rumo::obterValor() | |
{ | |
return valor; | |
} | |
void Rumo::setValor(int v) | |
{ | |
valor = v; | |
} |
This file contains hidden or 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 RUMO_H | |
#define RUMO_H | |
class Rumo | |
{ | |
private: | |
int valor; | |
public: | |
void setValor(int v); | |
int obterValor(); | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment