CS 1200 Lec

studied byStudied by 2 people
5.0(1)
get a hint
hint

Array

1 / 46

Tags and Description

47 Terms

1

Array

a collection of consecutive memory locations

New cards
2

Name and Type

Array is a group of variables with the same ___ and ___

New cards
3

datatype arrayname[size];

syntax for declaring arrays

New cards
4

0

If there is not enough values in the array, elements are set to ____

New cards
5

Number of Values

If size is not explicitly defined, the size is determined by the _________

New cards
6

Access Array Elements

procedure where the index of an array element is specified

New cards
7

arrayname [index]

syntax for accessing array elements

New cards
8

0 to size-1

Elements of an array are indexed from ____ to ____

New cards
9

Constant, Variable, or any Integer Expression

Index may be ____, ____, or ____.

New cards
10

False

True or False. C checks array bounds.

New cards
11

Array of arrays

Multidimensional arrays are also called as _____.

New cards
12

Row and Column

In a matrix named M, it is referenced as M[x][y]. What does x and y represent?

New cards
13

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}};

New cards
14

True

True or False. One of the ways in initializing a 2D array is:

int c[2][3]={1.3.0.-1.5,9};

New cards
15

String

array of characters

New cards
16

NULL Character

String is terminated by a ________.

New cards
17

String Constant

String Literals is also called as ______.

New cards
18

Double Quotes

String literals are enclosed in a ______.

New cards
19

Placeholder or Format Specifier

%s is the _____ for strings.

New cards
20

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.

New cards
21

Backslash

syntax of splicing which contains 4 spaces or indentations

New cards
22

First character

In C, compiler treats a string literal as a pointer to the ______.

New cards
23

String Variable

single array of characters that is capable of holding a string at a time

New cards
24

False

True or False. We can modify string literals.

New cards
25

scanf()

_____ is a function that does not store the white space characters in the string variable.

New cards
26

%ns

A way to set the limit of scanf() for the number of characters to be stored in the character array.

New cards
27

A library that contains all the required functions for performing string operations.

New cards
28

strcpy()

A function that is used to copy a string pointed by a source (including NULL character to the destination (character array).

New cards
29

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.

New cards
30

strcpy(destination,course);

syntax of strcpy() function

New cards
31

strncpy(destination, source, sizeof(destination));

syntax of strncopy() function

New cards
32

strlen()

A function that is used to determine the length of the given string.

New cards
33

False

strlen() counts the NULL character.

New cards
34

strcat()

string concatenate function

New cards
35

strcat()

A function that appends the content of string str2 at the end of the string str1.

New cards
36

strncat()

A safer version of strcat.

New cards
37

strncat()

A function that appends the limited number of characters specified by the third argument passed to it.

New cards
38

False

strncat() function does not automatically add NULL character at the end of the resultant string.

New cards
39

strncat(str1, str2, sizeof(str1) - strlen(str2) - 1);

syntax of strncat()

New cards
40

strcmp ()

string comparison function

New cards
41

less than

strcmp() returns a value that is ____ 0, if s1 < s2

New cards
42

greater than

strcmp() returns a value that is _____ 0, if s1 > s2

New cards
43

equal to

strcmp() returns a value that is ____ 0, if s1 == s2

New cards
44

65 to 90

range of ASCII codes of upper case letters

New cards
45

97 to 122

range of ASCII codes of lower case letters

New cards
46

48 to 57

range of ASCII codes of 0 to 9 digits

New cards
47

32

ASCII code of space character

New cards

Explore top notes

note Note
studied byStudied by 171 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 11 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 2 people
Updated ... ago
4.5 Stars(2)
note Note
studied byStudied by 40 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 17 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 105233 people
Updated ... ago
4.9 Stars(667)

Explore top flashcards

flashcards Flashcard77 terms
studied byStudied by 68 people
Updated ... ago
5.0 Stars(3)
flashcards Flashcard35 terms
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard42 terms
studied byStudied by 64 people
Updated ... ago
5.0 Stars(3)
flashcards Flashcard143 terms
studied byStudied by 52 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard124 terms
studied byStudied by 42 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard67 terms
studied byStudied by 32 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard130 terms
studied byStudied by 36 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard49 terms
studied byStudied by 15 people
Updated ... ago
5.0 Stars(1)