All pastes #912892 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-02-21 18:30 UTC
rendered paste body
#include <iostream>
using namespace std;

class bola {
    public:
    string cor;
    bola(string c) { cor = c; }
    void setacor(string c) { cor = c; }
    void pegacor() { cout<<"Cor da bola: "<<cor<<endl; }
};

int main(int argc, char *argv[]) {
    bola minhabola("vermelha");
    minhabola.pegacor();
    minhabola.setacor("azul");
    minhabola.pegacor();
    system("PAUSE");
    return 0;
}