Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- class hallo {
- public:
- char feld[3] = { '1', '2', '3' };
- };
- void machwas() {
- hallo surr;
- surr.feld[0] = 'X';
- surr.feld[1] = ' ';
- surr.feld[2] = 'O';
- }
- void show_field() {
- hallo surr;
- cout << surr.feld[0] << surr.feld[1] << surr.feld[2] << endl;
- }
- int main()
- {
- hallo surr;
- show_field(); //ausgabe = 1 2 3
- cin.get();
- machwas(); // irgendwas funktioniert hier nicht...
- show_field(); // ... ausgabe immernoch 1 2 3 anstatt X ' ' O
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement