w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Use of pointers in multi dimensional arrays in C

The array is 0-indexed, so 2 and 5 are the spots before each sub-array starts, so it puts a line break before outputting them.

    {{1,2,3} , {4,5,6} , {7,8,9}};
 i=0--^   ^--i=2    ^--i=5

output looks something like this:

Elements of an array with their address
3021239472[1]3021239476[2]3021239480[3]
3021239484[4]3021239488[5]3021239492[6]
3021239496[7]3021239500[8]3021239504[9]

Notice each dimension of the array has its own line.

(Memory addresses may vary)





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.