How come this works perfectly? Replacing a 2d character array with 1d array.
I have a test coming up soon I was wondering how come this works.
For example, if you needed to read in a list of names from an input file and store them into an array, its normal for one to think to use a 2d array and just address the rows of the array to access each name.
A programmer that I know showed me that this can be done with a 1d array, how is this possible?
in the declaration he declares the 1d array as follows:
(or something similar)
This does not work without the pointer after char.
and he can access an entire string in 1 position in the character array which makes no sense to me.