Free flashcard deck
As vrea sa inteleg mai bine limbajul C flashcards
20 cards, Medium, made and shared by a student on FORKSAI.
FORKSAI brings each card back with spaced repetition, right before you would forget it. Free to start, no card needed.
All 20 cards
Card 1
Define what a programming language is.
Programming languages are similar to human languages, containing words, punctuation, mathematical operations, and specific writing rules. They are used to write programs that run on computers.
Card 2
Explain the difference between 'compilation' and 'interpretation' in the context of programming languages.
Compilation is the process of translating a source program into machine code (executable program) for languages like C, C++, and Pascal. Interpretation is the translation process for languages like PHP, Python, and Javascript, performed by an interpreter.
Card 3
How does a 'program sursă' (source program) relate to 'cod mașină' (machine code) or 'program executabil' (executable program)?
A source program, written in a programming language, must be translated into machine code or an executable program, which is the language understood by the processor. This translation is done by a compiler or interpreter.
Card 4
What is the role of a 'compilator' (compiler) or 'interpretor' (interpreter)?
A compiler or interpreter is a specialized program responsible for translating a source program written in a programming language into machine code or an executable program that the computer's processor can understand and execute.
Card 5
Describe the purpose of the 'editarea programului C++' step in writing a C++ program.
The 'editarea programului C++' step involves writing the C++ program, typically using a text editor or an IDE, which results in the creation of the source file with a .cpp extension.
Card 6
Explain the 'compilarea fișierului sursă' step in C++ programming.
During the 'compilarea fișierului sursă' step, the program's syntactic correctness is checked. If it's syntactically correct, an object file with a .o or .obj extension is produced.
Card 7
What happens during the 'editarea de legături' (linking) stage of C++ program development?
In the 'editarea de legături' stage, connections are established between the current object file and other object files, which can be programmer-defined or included in the compiler. This process ultimately yields the executable program.
Card 8
What is the significance of the `int main()` line in a C++ program?
The `int main()` line declares a special function named `main`. This function is unique because it is the entry point for program execution and must appear exactly once in every C++ program.
Card 9
How do curly braces `{}` function in a C++ program?
Curly braces `{}` are used to delimit the instructions that belong to a function, such as the `main` function. They define the scope of the function's code block.
Card 10
What is an 'instrucțiune C++' (C++ instruction) and what is its primary role?
A C++ instruction is a construct (expression, command) that performs a specific action. Instructions are the core of programs, defining their behavior and executing sequentially.
Card 11
Why is the semicolon `;` important at the end of a C++ instruction?
The semicolon `;` is crucial because it marks the end of a C++ instruction. Forgetting to include it is a common syntax error that prevents the program from compiling correctly.
Card 12
What is the purpose of the `return 0;` instruction in the `main` function?
The `return 0;` instruction signifies the successful completion of the `main` function and, consequently, the entire program. Any instructions placed after it would not be executed.
Card 13
Distinguish between a single-line comment and a block comment in C++.
A single-line comment in C++ starts with `//` and extends to the end of the line. A block comment starts with `/*` and ends with `*/`, allowing it to span multiple lines.
Card 14
How do comments affect the execution of a C++ program?
Comments are purely explanatory texts for programmers and do not influence the program's behavior or its compilation. They are ignored by the compiler and are solely for human readability.
Card 15
Explain the role of `std::cout` in C++.
`std::cout` represents the standard character output device, which is typically the computer screen. It is used in C++ to display text or other data to the user.
Card 16
What is the function of the `<<` operator when used with `std::cout`?
The `<<` operator, known as the insertion operator, indicates that the data following it should be inserted into `std::cout`, effectively sending it to the standard output device, usually the screen.
Card 17
How can you make `std::cout` and `std::endl` easier to use without explicitly writing `std::` every time?
To simplify the use of identifiers like `cout` and `endl` from the `std` namespace, the instruction `using namespace std;` can be included in the program. This allows direct reference to these identifiers without the `std::` prefix.
Card 18
What is the significance of the `iostream` header in a C++ program?
The `iostream` header is a standard C++ library component that provides functionalities for input and output operations, such as displaying messages on the screen using `std::cout`.
Card 19
Why is `std::endl` used in C++ programs?
`std::endl` is used to insert a newline character into the output stream and then flush the buffer. This ensures that subsequent output appears on a new line on the screen.
Card 20
What are namespaces in C++ and what is the `std` namespace?
Namespaces in C++ are used to group identifiers, preventing naming conflicts. The `std` namespace is a predefined namespace that contains all the identifiers from the standard C++ library, such as `cout` and `endl`.
Study As vrea sa inteleg mai bine limbajul C the way that sticks
Reading cards is not the same as remembering them. In FORKSAI you answer each card before you see the back, and the ones you miss come back first.
Study these cards freeMore flashcard decks
- Thermochemistry and Thermodynamics flashcards (149 cards)
- Género Bacillus y Clostridium flashcards (100 cards)
- Ψηφιακά Παιχνίδια και Μάθηση flashcards (100 cards)
- Philosophy AS flashcards (100 cards)
- Nervous system flashcards (100 cards)
- ECG, IGEL and Iv flashcards (100 cards)