Guest User

Untitled

a guest
Nov 26th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <Windows.h>
  4.  
  5. using namespace std;
  6.  
  7. // deklaracja funkcji zewnętrznej
  8. extern "C" INT64  tablica(INT64* tab1, INT64* tab2, int count);
  9.  
  10. void Wyswietl(INT64* tab, int n) {
  11.     for (size_t i = 0; i < n; i++)
  12.     {
  13.         cout << "Tab[" << i << "]: " << tab[i] << endl;
  14.     }
  15. }
  16.  
  17. int main()
  18. {
  19.     int n = 200;
  20.     INT64* tab1 = new INT64[n];
  21.  
  22.     for (size_t i = 0; i < n; i++)
  23.     {
  24.         tab1[i] = 150 + i;
  25.     }
  26.  
  27.     cout << "Tablica 1" << endl;
  28.     Wyswietl(tab1, n);
  29.  
  30.     INT64* tab2 = new INT64[n];
  31.  
  32.     cout << "\nTablica 2" << endl;
  33.     Wyswietl(tab2, n);
  34.  
  35.     INT64 x = tablica(tab1, tab2, n);
  36.  
  37.     cout << "\nTablica 2 - po kopiowaniu" << endl;
  38.     Wyswietl(tab2, n);
  39.  
  40.     system("PAUSE");
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment