think array in c

Ok,here i will show the detail of array.

How to get length of array

In fact,we should class many scene.

String.

String is a array of char.As we all know,when you create a string or array of char.C will self-acting add a char(“ ”) to the end.So,when you create a array which length is 6.Finally,it length is 7.

Now we use this to get length.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
void getLength(char* a){
int i = 0;
if(a == NULL){
return;
}
while(a[i] != '