Facebook
From matiut2, 6 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 321
  1. // Wskaźnik_przy_pracy_z_tablicą.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.         int *wi;
  11.         double *wd;
  12.         int tablint[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  13.         double tabldouble[10];
  14.  
  15.         wd = &tabldouble[0];                           
  16.  
  17.         for (int i = 0; 1 < 10; i++)           
  18.         {
  19.                 *(wd++) = i / 10.0;                            
  20.         }
  21.  
  22.         cout << "Tresc tablic na poczatku\n";
  23.  
  24.         wi = tablint;
  25.         wd = tabldouble;
  26.         for (int k = 0; k < 10; k++)
  27.         {
  28.                 cout << k << ") \t" << *wi << "\t\t\t\t" << *wd << endl;
  29.  
  30.                 wi++;
  31.                 wd++;
  32.         }
  33.  
  34.         wi = &tablint[5];
  35.         wd = tabldouble + 2;
  36.  
  37.         for (int m = 0; m < 4; m++)
  38.         {
  39.                 *(wi++) = -222;
  40.                 *(wd++) = -777.5;
  41.         }
  42.  
  43.         cout << "tresc tablic po wstawieniu nowych wartosci";
  44.         wi = tablint;
  45.         wd = tabldouble;
  46.         for (int p = 0; p < 10; p++)
  47.         {
  48.                 cout << "tablint [" << p << "] =  " << *(wi++) << "             \t\ttabldouble[" << p << "] = " << *(wd++) << endl;
  49.         }
  50.  
  51.  
  52.         cin.get();
  53.         cin.get();
  54.     return 0;
  55. }

Replies to Coś poszło nie tak - błąd unable to read memory rss

Title Name Language When
Re: Coś poszło nie tak - błąd unable to read memor matiut2 cpp 6 Years ago.