The C Family Flashcards
What does the term ‘imperative’ describe in programming?
Describes computation in terms of statements that change a program state
What is the opposite of imperative programming?
Declarative programming
What are the two main programming paradigms associated with C?
Procedural and functional
Is C a compiled or interpreted language?
Compiled
What type of typing does C use?
Statically, weakly typed
What does it mean for C to be statically typed?
Types are checked before runtime
What does weakly typed mean in the context of C?
Supports implicit type conversions
On what platforms is C available?
Pretty much every platform
What is a key characteristic of C regarding portability?
Very fast
What feature does C provide for memory management?
Explicit memory management
What standards does C adhere to?
ANSI/ISO standards
True or False: C has runtime error checking.
False
What type of error handling is lacking in C?
Sophisticated exception handling
What does GNU stand for?
GNU stands for ‘GNU’s Not Unix’
GNU is a free, UNIX-compatible operating system started by Richard Stallman in 1983.
What types of software packages does the GNU system include?
The GNU system includes various software packages, including:
* Compilers
* Libraries
* Tools
What is GCC?
GCC stands for GNU Compiler Collection, a powerful compiler that allows compiling different programming languages including:
* C
* C++
* Objective-C
* Fortran
* Java
* Ada
* Go
What command is used to compile a C program with GCC?
gcc myProgram.c
What is the default name of the executable file created by GCC?
a.out
How can you run the compiled program in Linux?
./a.out
How can you specify a custom output file name when compiling with GCC?
Use the -o option, e.g., gcc myProgram.c -o myProgram
What is the purpose of compiling to an object file?
Object files are portable and don’t need the full source code. They allow linking multiple object files to create a final executable.
What command is used to compile a C program into an object file?
gcc -c myProgram.c -o myProgram.o
What command is used to link an object file and create an executable?
gcc myProgram.o -o myProgram
What is the command to compile multiple source files at once?
gcc circle.c radius.c -o circle -lm