CSSE2310 Lecture 2: Booleans, Vim, and Tic Tac Toe Implementation

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/17

flashcard set

Earn XP

Description and Tags

Practice flashcards covering C Boolean types, Vim configuration settings for CSSE2310, and implementation details for a Tic Tac Toe program including library headers and array logic.

Last updated 12:17 AM on 6/18/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

18 Terms

1
New cards

In the C programming language, how are numerical values interpreted as Boolean values?

A value of 00 is interpreted as false, while any non-zero value is interpreted as true.

2
New cards

What header file must be included to use the specific boolbool type in C?

stdbool.hstdbool.h

3
New cards

Why is stdbool.hstdbool.h required instead of the boolbool type being a standard, built-in part of the original C language?

The boolbool type was added to the C language later, and developers had already defined their own Boolean types in the interim.

4
New cards

What is the effect of the pre-increment operator used in the expression ++i++i?

It increments the variable ii by 11 (i=i+1i = i + 1) and then returns the new value for use in the expression.

5
New cards

What does the expression if(x=7)if (x = 7) do in C if the programmer intended to check if xx equals 77?

It performs an assignment operation, setting xx to 77, and since the result (77) is non-zero, the condition always evaluates to true.

6
New cards

What is the path for the standard Vim configuration file recommended in the course?

local/courses/csse2310/resources/vimrclocal/courses/csse2310/resources/vimrc

7
New cards

According to the lecture's style guide, what is the maximum number of characters permitted per line?

8080 characters (with a ruler often set at column 8181).

8
New cards

In the provided Vim configuration, what keyboard shortcut is mapped to reformat code to match the style guide's indentation and spacing?

Control+kControl+k

9
New cards

When passing an array to a function in C, what is actually passed?

A pointer to the first element (firstmemberfirst\,member) of the array, rather than a copy of the entire array.

10
New cards

If a Tic Tac Toe board is represented by cell numbers 00 through 88, what formula converts a cell number to a row number in a 3×33 \times 3 grid?

\text{row} = \text{cell_number} / 3

11
New cards

What is the modulo formula for determining the column number from a cell number in a 3×33 \times 3 grid?

\text{column} = \text{cell_number} \pmod 3

12
New cards

Which function is used in the lecture to read a string from standard input while specifying a buffer size?

fgets()fgets()

13
New cards

What header file is required to use the atoi()atoi() function for converting strings to integers?

stdlib.hstdlib.h

14
New cards

What is a specific behavior of the atoi()atoi() function when it encounters a string that is not a numeric value?

It returns 00 without performing error checking on the string.

15
New cards

Which header file must be included to use the character check function isdigit()isdigit()?

ctype.hctype.h

16
New cards

How does the fgets()fgets() function handle new line characters?

If a new line character is read, it is stored into the buffer.

17
New cards

What header is necessary to use the strlen()strlen() function for calculating the length of a string?

string.hstring.h

18
New cards

How does the ternary operator player==x?o:xplayer == 'x' ? 'o' : 'x' function?

It evaluates if the current player is x'x'; if true, it returns o'o'; otherwise, it returns x'x'.