Initial commit

This commit is contained in:
Michael Reber
2019-11-15 12:59:38 +01:00
parent 40a414d210
commit b880c3ccde
6814 changed files with 379441 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
Arrays of Objects
#include <iostream>
using namespace std;
class MyClass {
int i;
public:
void setInt(int j) {
i=j;
}
int getInt() {
return i;
}
};
int main()
{
MyClass myObject[3];
int i;
for(i=0; i<3; i++)
myObject[i].setInt(i+1);
for(i=0; i<3; i++)
cout << myObject[i].getInt() << "\n";
return 0;
}