Skip to content

Instantly share code, notes, and snippets.

@Chavao
Created May 22, 2012 02:51
Show Gist options
  • Save Chavao/2766233 to your computer and use it in GitHub Desktop.
Save Chavao/2766233 to your computer and use it in GitHub Desktop.
#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;
}
#include <iostream>
#include "rumo.h"
int Rumo::obterValor()
{
return valor;
}
void Rumo::setValor(int v)
{
valor = v;
}
#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