c - Can only one element of an array make a subarray? -


I'm not clear about everybody.

Suppose: a [3] = {1, 2,3}

whether 1,2 and 3 can be inducted in the form of A Are you Answer: In C, the array is basically an indicator with its length.

You can do this:

  int a [3] = {1,2,3}; Int * p1 = A; // or p1 = & amp; A [0] int * p2 = a + 2; // or p2 = & amp; A [2];   

and you can now work on p1 as an array of 2 elements ( {1,2} ), And as an array of P2 1 element ( {3} ), but you have to know or remember about sub-array lengths.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -