What is static array?and how it differs from char *ptr?

Showing Answers 1 - 3 of 3 Answers

kalayama

  • Dec 5th, 2006
 

A static array is an array with fixed number of dimentions and each dimention will have fixed length. You can not change the dimentions of the Static array during runtime.ex: int arr[10][20] It has Two dimentions. Each fixed, one to 10 other to 20.Well it differs from (char *) in mutiple ways. A startic array can be of any datatype and it will hold data not just address. To access the dataelemnets in the static array, we use array index which in turn is a pointer. For example, if I say a[2][3], I am reffering to the location (2,3) in the two dimention array. Now the dimention could be 3 or 4 or more. In all the cases, we can retrieve information by array index.On the other hand, (char *) is just a pointer to a character(Of datatype char). It has got nothing to do with arrays.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions