Dealing with int arrays in c++ -


i looking @ c++ code trying learn , came across strange , have no clue going on.

int a[100000];  int main() {     int n;     scanf("%d", &n);      (int = 0; < n; i++)     {         scanf("%d", + i);     } 

i understand happening except scanf("%d", + i); line happen­ing array here? adding integer read in console array? have understanding of java.

so if able translate java. able understand happening.

a + i same &a[i], or in other words, a[i] same *(a + i). a + i address of ith element (count starting @ zero).


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -