Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- typedef struct stArray {
- float a[10];
- };
- class dim_class {
- private:
- stArray array;
- stArray array2;
- public:
- dim_class();
- ~dim_class();
- void dim_data (int *aa);
- void dim_show();
- int res();
- };
- int main()
- {
- dim_class prim;
- prim.dim_class();
- prim.dim_data(mm);
- prim.res();
- return 0;
- }
- dim_class::dim_class() {
- for(int i = 0; i < 10; i++) {
- array.a[i] = 0;
- }
- for(int i = 0; i < 10; i++) {
- array2.a[i] = 0;
- }
- }
- dim_class::~dim_class() {
- }
- void dim_class::dim_show() {
- for (int i = 0; i < 10; i++) {
- cout << "Значение переменной a[" << i << "] равно " << a[i] << endl;
- }
- }
- void dim_class::dim_data(int *aa) {
- for (int i = 0; i < 10; i++) {
- *(array.a + i) = *(aa + i);
- }
- }
- int dim_class::res() {
- int res=0;
- for (int i = 0; i < 10; i++) {
- for (int j = 0; j < 10; j++) {
- if(array.a[i] != array2.a[j]) {
- cout << "array.a[" << i << "] = " << array.a[i] << " [ != ] " << "array2.a[" << j << "] = " << array2.a[j] << endl;
- }
- }
- }
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement