Learn and Master C Programming - Using 'extern' Keyword in our code

Learn and Master C Programming - Using 'extern' Keyword in our code

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial guides viewers through creating a new C project in Visual Studio, focusing on using the extern keyword to manage global variables across multiple files. It covers setting up the project, implementing functions, resolving compilation errors, and using forward declarations. The tutorial concludes with successfully compiling and running the project, demonstrating the output of global variable manipulation.

Read more

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the first step in setting up a new project in Visual Studio?

Install a new compiler

Open the command prompt

Create a new folder on the desktop

Click on 'File' and select 'New Project'

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why does the compiler show an error when trying to use a global variable in another file?

The variable is declared as static

Each file is a separate compilation unit

The variable is not initialized

The variable is not used in the main function

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to reference a global variable from another file?

global

extern

public

static

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a function prototype in C?

To define the function

To declare the function before its use

To compile the function separately

To execute the function

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the program after running it successfully?

count equals 10, count equals 10

count equals 20, count equals 10

count equals 20, count equals 20

count equals 10, count equals 20