Pokazivaci

-Uvod u C++-


Website maintained by ntrifunovic Theme by mattgraham modified by ntrifunovic

(eng. Pointers)

Primer:

int x = 10;
int *px = &x, y; // y nije pokazivac
*px = 3;
y = x;

Koja je vrednost u promenjivoj y ?

Resenje: 3

// Pristupanje elementima strukture preko pointera
Tacka *pt = &t;
(*pt).x = 0;
pt->y = 0;

comments powered by Disqus