Array
a collection of consecutive memory locations
Name and Type
Array is a group of variables with the same ___ and ___
datatype arrayname[size];
syntax for declaring arrays
0
If there is not enough values in the array, elements are set to ____
Number of Values
If size is not explicitly defined, the size is determined by the _________
Access Array Elements
procedure where the index of an array element is specified
arrayname [index]
syntax for accessing array elements
0 to size-1
Elements of an array are indexed from ____ to ____
Constant, Variable, or any Integer Expression
Index may be ____, ____, or ____.
False
True or False. C checks array bounds.
Array of arrays
Multidimensional arrays are also called as _____.
Row and Column
In a matrix named M, it is referenced as M[x][y]. What does x and y represent?
False. ‘Di pweds i-omit ‘yong size ng column, pero okay lang if row (e.g., int c[][3]={{1,3,0},{2,5,7}};)
True or False. One of the ways in initializing a 2D array is
int c[2][]={{1,3,0},{2,5,7}};
True
True or False. One of the ways in initializing a 2D array is:
int c[2][3]={1.3.0.-1.5,9};
String
array of characters
NULL Character
String is terminated by a ________.
String Constant
String Literals is also called as ______.
Double Quotes
String literals are enclosed in a ______.
Placeholder or Format Specifier
%s is the _____ for strings.
Splicing
In C programming, it is used if the string literal contains a big sentence to the point where it reached a new line in the code.
Backslash
syntax of splicing which contains 4 spaces or indentations
First character
In C, compiler treats a string literal as a pointer to the ______.
String Variable
single array of characters that is capable of holding a string at a time
False
True or False. We can modify string literals.
scanf()
_____ is a function that does not store the white space characters in the string variable.
%ns
A way to set the limit of scanf() for the number of characters to be stored in the character array.
A library that contains all the required functions for performing string operations.
strcpy()
A function that is used to copy a string pointed by a source (including NULL character to the destination (character array).
True
True or False. In the strcpy(str1,str2), if the length of the string pointed by str2 is greater than the length of the character array str1 then it will be an undefined behavior.
strcpy(destination,course);
syntax of strcpy() function
strncpy(destination, source, sizeof(destination));
syntax of strncopy() function
strlen()
A function that is used to determine the length of the given string.
False
strlen() counts the NULL character.
strcat()
string concatenate function
strcat()
A function that appends the content of string str2 at the end of the string str1.
strncat()
A safer version of strcat.
strncat()
A function that appends the limited number of characters specified by the third argument passed to it.
False
strncat() function does not automatically add NULL character at the end of the resultant string.
strncat(str1, str2, sizeof(str1) - strlen(str2) - 1);
syntax of strncat()
strcmp ()
string comparison function
less than
strcmp() returns a value that is ____ 0, if s1 < s2
greater than
strcmp() returns a value that is _____ 0, if s1 > s2
equal to
strcmp() returns a value that is ____ 0, if s1 == s2
65 to 90
range of ASCII codes of upper case letters
97 to 122
range of ASCII codes of lower case letters
48 to 57
range of ASCII codes of 0 to 9 digits
32
ASCII code of space character