⚙️ Moyen 10 questions

QCM CPP - C (Partie 9)

Quiz interactif avec 10 questions. Testez vos connaissances!

#cpp

Comment jouer ?

  • 1. Lisez chaque question attentivement
  • 2. Choisissez votre réponse parmi les options
  • 3. Cliquez sur "Voir la réponse" pour vérifier
  • 4. Comptez vos bonnes réponses à la fin !

Quiz: QCM CPP - C (Partie 9)

10 questions | Difficulté: moyen


Question 1

What is the name of the compiler commonly used on Linux systems?

  • A. GNU C compiler
  • B. GNU compiler collection
  • C. cc
  • D. clang
Voir la réponse

Réponse correcte: B

On Linux systems, ‘cc’ is often an alias for GCC.


Question 2

What kind of files contain function definitions in C programs?

  • A. Source files
  • B. Header files
  • C. Object files
  • D. Binary executables
Voir la réponse

Réponse correcte: A

Source files contain function definitions.


Question 3

What is the purpose of header files in C programs?

  • A. They contain function prototypes
  • B. They contain function definitions
  • C. They are used to compile the program
  • D. They are used to execute the program
Voir la réponse

Réponse correcte: A

Header files contain function prototypes and various pre-processor statements.


Question 4

What is the default standard supported by a POSIX compliant C compiler mandated by the standards?

  • A. C89
  • B. C90
  • C. C99
  • D. C11
Voir la réponse

Réponse correcte: C

POSIX currently mandates c99 as the name of a C compiler.


Question 5

What suffix does an object file have on Unix operating systems?

  • A. .c
  • B. .h
  • C. .o
  • D. .exe
Voir la réponse

Réponse correcte: C

Object files end in .o by convention.


Question 6

What does the -Wall option do when used with gcc?

  • A. It tells the compiler to print warnings about questionable constructions
  • B. It tells the compiler to compile the program
  • C. It tells the compiler to execute the program
  • D. It tells the linker to link the program
Voir la réponse

Réponse correcte: A

The -Wall option present in both gcc examples tells the compiler to print warnings about questionable constructions.


Question 7

What is a static library?

  • A. A compiled binary that is an executable
  • B. A compiled binary but is not in itself an executable (i.e., there is no main() function in a library)
  • C. A linker program
  • D. An object file
Voir la réponse

Réponse correcte: B

A static library contains functions that may be used by more than one program but is not an executable.


Question 8

What is the suffix of a dynamic library on POSIX systems?

  • A. .a
  • B. .lib
  • C. .so
  • D. .dll
Voir la réponse

Réponse correcte: C

On POSIX systems, static libraries have the .a extension.


Question 9

What is the purpose of the linker in C programs?

  • A. It compiles the program
  • B. It links together a number of object files to produce a binary file which can be directly executed
  • C. It creates header files
  • D. It creates source files
Voir la réponse

Réponse correcte: B

The linker links together a number of object files to produce a binary file which can be directly executed.


Question 10

What is the suffix of a binary executable on Windows?

  • A. None
  • B. .exe
  • C. .c
  • D. .h
Voir la réponse

Réponse correcte: B

Binary executables have no special suffix on Unix operating systems, although they generally end in .exe on Windows.