#include "stdafx.h"
#include <iostream>
using namespace std;
class thing{
public:
int stuff, stuff1, stuff2;
void thingy(int stuff, int *stuff1){
stuff2=stuff-*stuff1;
}
}
int main(){
thing t;
int *ptr=t.stuff1;
t.thingy(t.stuff, *ptr);
}
私は C++ でクラスとポインターを練習してきました。私がやろうとしているのは、stuff1 の値へのポインターを渡すことによって、thing クラスの stuff2 データ メンバーを変更する関数を持たせることです。どうすればこれを行うことができますか?