Any character in an array can be accessed
individually by using a method called superscript notation.
The characters in an array are numbered,
beginning with zero:
Subscript notation makes for more readable
code than the dereferencing operator.
The compiler will not prevent you from going
beyond the length of your array when accessing characters in an array individually
When a character array is declared, the name
given the array is actually a pointer variable.
Write your answer in the space following
questions 6 through 10.
Write a statement that would assign the third element in the character array name to the
character y
Given the character array declared as char
Job[8] = "Plumber" ;
what character is returned by Job [4] ?
Given the character array declared as char
Job[8] = "Plumber" ;what would be returned by the expression * (Job + 4)
Given the character array declared as char
SSN[12] = "523-67-8941";, write a statement that will re-
place the character 6 with the character 1
Write a statement that will declare a
character array named time and initially set its value to 5:00. Follow that statement with
one that will change the contents of the character array to 5:01 by replacing only one
character in the array.
Write
a program that prompts the user for a string of text and stores it in a character array.
The program should then store the first character of the string into a variable of type
char named first-character and output the contents of first-character.
E-mail
the completed program to frung@krhs.net with the
subject Chap10 S2 N6