intro-classes-1 420 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#include <iostream>
using namespace std;

#define SIZE 10

    class myclass {
        double local = 3.10; // private stuff of myclass

    public: // public stuff of my class (function members)
        double func(int m); // function prototype
    };

    double myclass::func(int m) {
        return m * local;
    }

int main() {

    myclass c1;

    int m;
    cin >> m;

    cout << c1.func(m);

    return 0;

}