first commit
This commit is contained in:
commit
d47f1dc602
9 changed files with 1247 additions and 0 deletions
13
Code/CPP/CPP-Basics.md
Normal file
13
Code/CPP/CPP-Basics.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Structure of a Program
|
||||
|
||||
Every C++ program must have a function named **main** (all lower case letters). When the program is run, the statements inside of _main_ are executed in sequential order.
|
||||
|
||||
```
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello World!";
|
||||
return 0;
|
||||
}
|
||||
```
|
35
Code/CPP/Visual-Studio-Settings.md
Normal file
35
Code/CPP/Visual-Studio-Settings.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Visual Studio Dependencies
|
||||
|
||||
## Install dependencies
|
||||
|
||||
For developing C++ in Visual Studio 2022 on Windows 11 you have to install the _Desktop development with C++._ If you don't do this, the C++ capabilities will not be available.
|
||||
|
||||

|
||||
|
||||
## C++ Console Application
|
||||
|
||||
To create a C++ Console Application you have to create a new Project. In Visual Studio you select _Windows Desktop Wizard._ After naming the project the IDE opens the _Windows Desktop Project_ window. Make sure the Application type is on _Console Application (.exe)_ and that the _Precompiled Header_ option is unselected.
|
||||
|
||||
## Compiler Extensions
|
||||
|
||||
> **Best Practice**
|
||||
>
|
||||
> Disable compiler extensions to ensure your programs (and coding practice) remain compliant with C++ standards and will work on any System.
|
||||
|
||||
To do this you have to right click on your project name in the _Solution Explorer_ window, then choose _Properties_. First make sure the configuration is set to _All Configurations_. Then, click _C/C++ > Language tab,_ and set _Conformance mode _ to _Yes(/permissive-)._
|
||||
|
||||
## Warning and Error levels
|
||||
|
||||
> **Best Practice**
|
||||
>
|
||||
> Don't let warnings pile up. resolve them as you encounter them (as if they were errors). Otherwise a warning about a serious issue may be lost amongst warnings about non-serious issues.
|
||||
|
||||
You IDE can support you by handling the warnings. In the Solution Properties you can turn up your warning levels. To increase them, go to the _Properties_ of your solution and then you have to set for _All Configurations_ in _C/C++ > General _ then _Warning levels_ to _Level4 (/W4)_ and for more support the _Treat Warnings As Errors_ to _Yes (/WX)._
|
||||
|
||||
## Language standard
|
||||
|
||||
To select a language standard, open your solution properties, then open _C/C++ > Language._ Make sure the Configuration is set to _All Configurations._ From there, you can set the _C++ Language Standard_ to the version of C++ you wish to use.
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
> With Visual Studio, you will need to reselect your language standard every time you create a new project.
|
Loading…
Add table
Add a link
Reference in a new issue