C++ : Compile and Execute Flashcards

1
Q

To compile a file in c++, you’ll need to type

A

g++ followed by the file name then press enter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

To execute the new machine code file

A

all you need to do is type ./ and the machine code file name in the terminal and press enter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

For giving the specific name of the file

A

there should be -o and then the name that you want to give

g++ hello.cpp -o hello

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What you read and write is called

A

source code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what the computer executes is called

A

executable, object code, or machine code (a machine language).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A compiler translates the C++ program into

A

machine language code which it stores on the disk as a file with the extension .o (e.g. hello.o).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A linker then links the object code

A

with standard library routines that the program may use and creates an executable image which is also saved on disk, usually as a file with the file name without any extension (e.g. hello). (optional, understanding is no1 priority)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The executable is loaded from the disk

A

to memory and the computer’s CPU (Central Processing Unit) executes the program one instruction at a time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly