Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
80 Cards in this Set
- Front
- Back
Questions
|
Answers
|
|
The standard input file that C opens for you is
|
stdin
|
|
The gcc -Wall option means...
|
display all warnings
|
|
If you had two relational expressions and you wish to return true only if both of the expressions are true, you would use...
|
&&
|
|
The value that will be interpreted as a false boolean value is...
|
0
|
|
The return statement...
|
sets a function's return value anddddd returns the invoking function.
|
|
The escape sequence in a format string that is used to go to the beginning of the next line is...
|
\n
|
|
If you had two relational expressions and you wish to return true if eithe rof the expressions is true, you would use...
|
| |
|
|
A line comment begins with ...
|
//
|
|
gcc is an exampel of a...
|
compiler
|
|
To pass the address of a variable to the scanf function you would use the ________ operator.
|
&
|
|
A block comment begins with ___ and ends with ___.
|
/*, */
|
|
The #include statement is an exampel of a _____ statement.
|
Preprocessor
|
|
All of the following are ways to subtract 3 from num except...
|
num - 3 = num;
|
|
A block of executable code is indicated to gcc by ...
|
enclosing it in braces
|
|
The file produced by "gcc -Wall myProg.c" is ...
|
a.out
|
|
The data type that should be returned by main is
|
int
|
|
to use standard input and output functions, you generally #include
|
|
|
The repetition statement that will always execute the body of the loop at least once is the....
|
do while
|
|
Given: int var1, var2; - What is the set of code below that reads in two whole numbers into the variables?
|
scanf("%d %d", &var1, &var2);
|
|
String literal constants are enclosed in ____
|
double quotes
|
|
The gcc -lm option means ____
|
bind with the math library machine code
|
|
would war-peace be a valid or invalid identifier name to gcc?
|
invalid b/c of the -
|
|
would 3rd_year be a valid or invalid identifer name to gcc?
|
invalid b/c starts with #
|
|
If you had two arithmetic expressions adn you wish to return true if the first is NOT equal to the second you would use...
|
!=
|
|
Parameters passed to a function are passed by....
|
value
|
|
Given an array b for which the subscript of the last element is 100 and each element is 4 bytes long, sizeof(b) is ___.
|
404
|
|
Before a funciton can be used, a function's ___ MUST be defined.
|
prototype or definition
|
|
The keyword ___ is used in a functions header to indicate that the function does not return a value.
|
void
|
|
If you reference outside the bounds of an array, ____
|
The program will not check the subscript and the results are unpredictable
|
|
If you pass an arrya to a function and the function modifies an array element, ___
|
the actual array element will be modified
|
|
A variable defined outside of all functions
|
can be used in any function after the definition
|
|
The data types of function parameters must be specified to the compiler in ____
|
the function header
|
|
To reference the last element of array a of 25 elements you would specify...
|
a[24]
|
|
The _____ statement in a called function is ued to pass the value of an expression back to the call function.
|
return
|
|
To implement a list in a program you would use a ___.
|
one-dimensional array
|
|
Value-returning functions return ___ after the tast is completed.
|
a single value
|
|
to reference the first element of array a, you would specifiy
|
a[0]
|
|
An array subscript is always a ____
|
integer
|
|
If there are fewer initial values specified for an array than the number of elements in the array, the remaining elements are initialized to ____.
|
0
|
|
A ____ allows the compiler to check the number, types and order of the arguments passed to a function befoer the function has been defined.
|
function prototype
|
|
For a one dimensional array in a function definition header paramerter, the array's ____ is generally specified since it is ignored.
|
size
|
|
Local variables defined in a function block are normally unallocated ____.
|
at the end of the function block
|
|
The area in which a variable can be referenced is its
|
scope
|
|
A ____ should be used to specify the size of an array to make the program easier to change if the array needs to be changed.
|
named constant
|
|
When specifying initial values for an array, the initial values are separated by _____.
|
commas
|
|
The value that the main function returns to the operating system indicates ____
|
whether the program ended normally
|
|
When you specity initial values for a one-dimensional array and leave out the size, ___
|
the compiler will compute the size
|
|
(True or false) Every C prgoram contains at least one function.
|
TRUE
|
|
The block of code for a function is recognized by the compiler because it is _____.
|
enclosed in braces
|
|
The keyword ___ specifies that a local variable is to maintain its value after a funciton ends.
|
static
|
|
To define an integer array with 25 elements you could specify
|
int a[25];
|
|
A function is invoked with a ....
|
function call
|
|
(True or false) An individual array can store data of different C data types
|
FALSE
|
|
What is the form that will DYNAMICALLY allocate an arry of 100 integers from the heap?
|
int *nums = (int *) malloc(sizeof(int) * 100);
|
|
An array declared as: float sales[11][26] has how many rows and how many columns?
|
11 rows and 26 columns
|
|
The function calloc returns a pointer to a variable of type ____.
|
void
|
|
If an int variable x is to be passed to a function y simulating by reference, the PARAMETER LIST in the definition of y should contain....
|
int *x
|
|
Given teh execution of a program with the command ./a.out data_in.txt data_out.txt the value of the first paramter to main will be____.
|
3
|
|
The fopen modes for input, output create and output append are ___, ____, and ____.
|
"r", "w", and "a"
|
|
To compare two strings to see if they are equal, you use ___.
|
strcmp
|
|
The FILE function used to read from a sequential text file is ____.
|
fscanf (fgetf reads spaces, fscanf does not)
|
|
Strings are implemented in C as ____.
|
char array
|
|
To indicate that a pointer has no value assigned, it should be given a value of ___.
|
NULL
|
|
A pointer variable contains as its value the ___ of another variable.
|
Address
|
|
The character used to indicate the end of a string is ___
|
\0
|
|
The dynamic memory function that initializes memory to BINARY ZEROS is ____.
|
calloc
|
|
If the path to a file is not specified, the file location is assumed to be ____.
|
The current directory.
|
|
An array declared as: int score[6][12] has ____ int variables.
|
72
|
|
The final function call for an open file should be ____.
|
fclose
|
|
Which of the following declares the variable prt to be a pointer to a memory location that stores a double.
|
double *ptr;
|
|
If fopen cannot open a file, it returns ____.
|
NULL
|
|
The format placeholder to print out a string of text is ____.
|
%s
|
|
THe function fscanf's first argument is ___.
|
fp, the file pointer
|
|
Which will deallocate an array of 100 integers pointed to by aPtr
|
free(aPtr);
|
|
The function used to determine the lenght of a string is ____.
|
strlen
|
|
The SAFE function for reading a string that CAN CONTAIN SPACES is ____
|
fgets
|
|
If an int variable x is to be passed to a function y simulating by reference, the CALL to y should contain....
|
&x
|
|
The FILE function used to write to a SEQUENTIAL text file is ____.
|
fprintf
|
|
Which of the following will pass an array of 100 integers ointed to by aPtr and the number of elements to a void function named read_nums?
|
read_nums(aPtr, 100);
|