One dimensional array – C

Use of array to store a ‘string’ of characters. In the code below you’ll notice I’ve specified the array size as ’12’ which corresponds to the number of characters in ‘Hello World!’ including the white space. Not specifying the array size, i.e using arr[] = “Hello World!” would have automatically defined the size as 12. Doing this it would need to need to call the array values through their position numbers, i.e arr[0], arr[1] … arr[11].


Share this post