Programming/C++: Difference between revisions
Jump to navigation
Jump to search
Brodriguez (talk | contribs) (Add link) |
Brodriguez (talk | contribs) (Add link) |
||
Line 3: | Line 3: | ||
== C++ SubPages == | == C++ SubPages == | ||
* [[C++/Syntax]] | * [[C++/Syntax]] | ||
* [[C++/Pointers and Memory Management]] | |||
* [[C++/Objects and Data Structures]] | * [[C++/Objects and Data Structures]] | ||
* [[C++/Headers and File Including]] | * [[C++/Headers and File Including]] |
Revision as of 06:28, 7 March 2023
C++ SubPages
- C++/Syntax
- C++/Pointers and Memory Management
- C++/Objects and Data Structures
- C++/Headers and File Including
Compiling C++
To run any C++ code, it must first be compiled.
To do this, in terminal, cd to the desired directory and run g++ <path_to_file> -o <name_of_file_to_create>
.
This will generate a new executable file, based on the compiled code.
Run this file via ./<name_of_created_file>
.
Types of Errors
- Compile Time Errors - Errors that happen during file compile.
- Syntax Errors - Errors that happen from incorrect typed syntax for the given language.
- Type Errors - Errors that happen due to mismatch of declared type and attempted type usage.
- Link Time Errors - Errors that happen when trying to combine compiled files into a single executable program.
- Ex: Using a function that was never defined, or
Main()
instead of {{ ic |main()}.
- Ex: Using a function that was never defined, or
- Run Time Errors - Errors that happen during program execution.
- Ex: Divide-by-zero errors, or attempting to open a file mid-runtime and said file doesn't exist.
- Logic Errors - Soft errors that don't cause an actual crash. But can cause a program soft-lock, or general unintended behavior.