Serial.read() and for loop problems

Thanks everyone for your replies. So, I'm assuming that for an array of characters to be treated properly as a string in c it must have '\0' in the last element. Without this string functions will not return the expected results.

Paul, you are infering that the value of cmd is the memory address of the first element of the array, correct?

On a related note, I am used to working in VHDL where you can address a parts of an array, for example an array 8 bits wide, parts of the array can be referenced in the following way array[7 downto 4] for example looking at the first four bits of the array.

How is this done in c?