Created
April 6, 2015 20:00
-
-
Save developer10/b22a70b370de26866f77 to your computer and use it in GitHub Desktop.
Zadatak iz materijala (V4 - Pokazivaci)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
double niz[10] = {0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9}; | |
cout << sizeof(double) << "; " << " a ovaj niz zauzima: " << sizeof(niz) << endl; | |
double* pok; | |
pok = &niz[0]; | |
// pok = &niz[0]; | |
cout << niz[3] << endl; | |
cout << pok[3] << endl; | |
cout << *(niz+3) << endl; | |
cout << *(pok+3) << endl; | |
for (int i = 1; i <= 10; i++) | |
{ | |
cout << "Adresa " << i << ". elementa niza: " << pok << endl; | |
pok++; | |
} | |
cout << endl; | |
for (int i = 0; i < 10; i++) | |
{ | |
cout << "Element " << i+1 << ". glasi: " << *(pok+i) << endl; | |
} | |
system("Pause > 0"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment