All pastes #63657 Raw Edit

Something

public text v1 · immutable
#63657 ·published 2006-06-10 12:53 UTC
rendered paste body
#include <iostream>
using namespace std;

struct Vektori {
    public:
        float x,y,z;
};

Vektori kerroVektori(Vektori a, float b)
{
    a.x *= b;
    a.y *= b;
    a.z *= b;
    return a;
}

int main()
{
    Vektori v;
    v.x = v.y = v.z = 1;
    cout << "Vektori alussa" << endl;
    cout << "  x: " << v.x << endl;
    cout << "  y: " << v.y << endl;
    cout << "  z: " << v.z << endl;
    cout << endl;

    v = kerroVektori(v, 15.0f);

    cout << "Vektori lopussa" << endl;
    cout << "  x: " << v.x << endl;
    cout << "  y: " << v.y << endl;
    cout << "  z: " << v.z << endl;
}