Public feed #600613

kehnokaveri

public text v1 · immutable
Raw Edit
·published 2007-07-02 23:54 UTC
rendered paste body
class olento {
	public:
	string name;
	int x,y;	
} jannut[2];

*olento TarkistaRuutu (olento hahmot[5], char xa, char ya) {
	for (int n = 0; n < 5; n++) {
		if (hahmot[n].x == xa) {
			if (hahmot[n].y == ya) return &hahmot[n];
		}
	}
}

int main() {
	jannut[1].name="pelaaja";
	jannut[1].x=2;
	jannut[1].y=3;
	jannut[2].name="kehnokaveri";
	jannut[2].x=9;
	jannut[2].y=9;
	
	string blaah = TarkistaRuutu (jannut,2,3)->name;
	cout << blaah;

	return 0;
}