Flashcards in Strings Deck (6)
Loading flashcards...
1
How do you declare an array?
char string_var[size];
2
Null Character
Character '\0' that marks the end of a string in C.
3
For a given size n, how many characters can a string hold? How are the values of the character locations assigned?
- n-1, since the last charcter is reserved for a null character.
- Locations are defined from 0 to n-1.
4
How do you define an array of strings?
char array_name[array size][string size];
5
How can you initilize an array of strings?
char array_name[array size][string size] = {"string characters", "string characters"};
6
What placeholder do we use so printf and scanf can handle strings?
%s