CS 1200 Lec

5.0(1)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/46

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

47 Terms

1
New cards
Array
a collection of consecutive memory locations
2
New cards
Name and Type
Array is a group of variables with the same ___ and ___
3
New cards
datatype arrayname\[size\];
syntax for declaring arrays
4
New cards
0
If there is not enough values in the array, elements are set to ____
5
New cards
Number of Values
If size is not explicitly defined, the size is determined by the _________
6
New cards
Access Array Elements
procedure where the index of an array element is specified
7
New cards
arrayname \[index\]
syntax for accessing array elements
8
New cards
0 to size-1
Elements of an array are indexed from ____ to ____
9
New cards
Constant, Variable, or any Integer Expression
Index may be ____, ____, or ____.
10
New cards
False
True or False. C checks array bounds.
11
New cards
Array of arrays
Multidimensional arrays are also called as _____.
12
New cards
Row and Column
In a matrix named M, it is referenced as M\[x\]\[y\]. What does x and y represent?
13
New cards
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}};
14
New cards
True
True or False. One of the ways in initializing a 2D array is:

\
int c\[2\]\[3\]={1.3.0.-1.5,9};
15
New cards
String
array of characters
16
New cards
NULL Character
String is terminated by a ________.
17
New cards
String Constant
String Literals is also called as ______.
18
New cards
Double Quotes
String literals are enclosed in a ______.
19
New cards
Placeholder or Format Specifier
%s is the _____ for strings.
20
New cards
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.
21
New cards
Backslash
syntax of splicing which contains 4 spaces or indentations
22
New cards
First character
In C, compiler treats a string literal as a pointer to the ______.
23
New cards
String Variable
single array of characters that is capable of holding a string at a time
24
New cards
False
True or False. We can modify string literals.
25
New cards
scanf()
_____ is a function that does not store the white space characters in the string variable.
26
New cards
%ns
A way to set the limit of scanf() for the number of characters to be stored in the character array.
27
New cards
A library that contains all the required functions for performing string operations.
28
New cards
strcpy()
A function that is used to copy a string pointed by a source (including NULL character to the destination (character array).
29
New cards
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.
30
New cards
strcpy(destination,course);
syntax of strcpy() function
31
New cards
strncpy(destination, source, sizeof(destination));
syntax of strncopy() function
32
New cards
strlen()
A function that is used to determine the length of the given string.
33
New cards
False
strlen() counts the NULL character.
34
New cards
strcat()
string concatenate function
35
New cards
strcat()
A function that appends the content of string str2 at the end of the string str1.
36
New cards
strncat()
A safer version of strcat.
37
New cards
strncat()
A function that appends the limited number of characters specified by the third argument passed to it.
38
New cards
False
strncat() function does not automatically add NULL character at the end of the resultant string.
39
New cards
strncat(str1, str2, sizeof(str1) - strlen(str2) - 1);
syntax of strncat()
40
New cards
strcmp ()
string comparison function
41
New cards
less than
strcmp() returns a value that is ____ 0, if s1 < s2
42
New cards
greater than
strcmp() returns a value that is _____ 0, if s1 > s2
43
New cards
equal to
strcmp() returns a value that is ____ 0, if s1 == s2
44
New cards
65 to 90
range of ASCII codes of upper case letters
45
New cards
97 to 122
range of ASCII codes of lower case letters
46
New cards
48 to 57
range of ASCII codes of 0 to 9 digits
47
New cards
32
ASCII code of space character