• Complain

Mikael Olsson - C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library

Here you can read online Mikael Olsson - C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2018, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Mikael Olsson C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library
  • Book:
    C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2018
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

This quick C++17 guide is a condensed code and syntax reference to the popular programming language, fully updated for C++17. It presents the essential C++ syntax in a well-organized format that can be used as a handy reference.
In the C++17 Quick Syntax Reference, you will find short, simple, and focused code examples. This book includes a well laid out table of contents and a comprehensive index allowing for easy review. You wont find any technical jargon, bloated samples, drawn out history lessons, or witty stories in this book. What you will find is a language reference that is concise, to the point and highly accessible. The book is packed with useful information and is a must-have for any C++ programmer.
What Youll Learn
  • Use template argument deduction for class templates
  • Declare non-type template parameters with auto-folding expressions and auto deduction from braced-init-list
  • Apply lambdas and lambda capture by value
  • Work with inline variables, nested namespaces, structured bindings, and selection statements with initializer
  • Use utf-8 character literals
  • Carry out direct-list initialization of enums
  • Use these new C++17 library features or class templates from std::variant, optional, any, string_view, invoke, apply and more
  • Do splicing for maps and sets, also new to C++17

Who This Book Is For
Experienced C++ programmers. Additionally, this is a concise, easily-digested introduction for other programmers new to C++.

Mikael Olsson: author's other books


Who wrote C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library? Find out the surname, the name of the author of the book and a list of all author's works by series.

C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Mikael Olsson 2018
Mikael Olsson C++17 Quick Syntax Reference
1. Hello World
Mikael Olsson 1
(1)
Hammarland, Finland
Choosing an IDE
To begin developing in C++ you need a text editor and a C++ compiler. You can get both at the same time by installing an Integrated Development Environment (IDE) that includes support for C++. A good choice is Microsoft's Visual Studio Community Edition, which is a free version of Visual Studio that is available from Microsofts website. This IDE has full support for the C++14 standard and includes most features of C++17 as of the 2017 version.
Two other popular cross-platform IDEs include NetBeans and Eclipse CDT. Alternatively, you can develop using a simple text editor such as Notepad, although this is less convenient than using an IDE. If you choose to use a simple text editor, just create an empty document with a .cpp file extension and open it in the editor of your choice.
Creating a Project
After installing Visual Studio, go ahead and launch the program. You then need to create a project, which will manage the C++ source files and other resources. Go to File New Project in Visual Studio to display the New Project window. From there, select the Visual C++ template type in the left frame. Then select the Empty Project template in the right frame. At the bottom of the window, you can configure the name and location of the project. When you are finished, click the OK button to let the wizard create your empty project.
Adding a Source File
You have now created a C++ project. In the Solution Explorer pane (choose View Solution Explorer), you can see that the project consists of three empty folders: Header Files, Resource Files, and Source Files. Right-click on the Source Files folder and choose Add New Item. From the Add New Item dialog box, choose the C++ file (.cpp) template. Give this source file the name MyApp and click the Add button. An empty .cpp file will now be added to your project and opened for you.
Selecting Language Standard
To enable the latest features of the C++ language outlined in this book it is necessary to manually change the language standard setting for your project. You can do this by first going to Project Properties to bring up the Property pages. From there, navigate to Configuration Properties C/C++ Language C++ Language Standard. Select the ISO C++17 standard from the drop-down list. Click OK and the project will now be configured to compile according to the C++17 language standard.
Hello World
The first thing to add to the source file is the main() function. This is the entry point of the program, and the code inside of the curly brackets is executed when the program runs. The brackets, along with their content, is referred to as a code block, or just a block.
int main() {}
The first application will simply output the text "Hello World" to the screen. Before this can be done the iostream header needs to be included. This header provides input and output functionality for the program, and it is one of the standard library files that comes with all C++ compilers. The #include directive effectively replaces the line with everything in the specified header before the file is compiled into an executable.
#include
int main() {}
With iostream included, you gain access to several new functions. These are all located in the standard namespace called std , which you can examine by using a double colon, also called the scope resolution operator ( :: ) . After typing this in Visual Studio, the IntelliSense window will automatically open, displaying the namespace contents. Among the members you find the cout stream, which is the standard output stream in C++ that will be used to print text to a console window. It uses two less than signs, collectively known as the insertion operator ( << ), to indicate what to output. The string can then be specified, delimited by double quotes, and followed by a semicolon. The semicolon is used in C++ to mark the end of all statements.
#include
int main()
{
std::cout << "Hello World";
}
Using the Standard Namespace
To make things a bit easier, you can add a line specifying that the code file uses the standard namespace. You then no longer have to prefix cout with the namespace ( std:: ) since it is used by default.
#include
using namespace std;
int main()
{
cout << "Hello World";
}
IntelliSense
When writing code in Visual Studio, a window called IntelliSense will pop up wherever there are multiple predetermined alternatives from which to choose. This window can be also brought up manually at any time by pressing Ctrl+Space to provide quick access to any code entities you are able to use within your program. This is a very powerful feature that you should learn to make good use of.
Footnotes
http://www.microsoft.com/visualstudio
Mikael Olsson 2018
Mikael Olsson C++17 Quick Syntax Reference
2. Compile and Run
Mikael Olsson 1
(1)
Hammarland, Finland
Visual Studio Compilation
Continuing from the last chapter, the Hello World program is now complete and ready to be compiled and run. You can do this by going to the Debug menu and clicking on Start Without Debugging (Ctrl+F5). Visual Studio then compiles and runs the application, which displays the text in a console window.
If you select Start Debugging (F5) from the Debug menu instead, the console window displaying Hello World will close as soon as the main function is finished. To prevent this, you can add a call to the cin.get function at the end of main. This function, belonging to the console input stream, will read input from the keyboard until the Return key is pressed.
#include
using namespace std;
int main()
{
cout << "Hello World";
cin.get();
}
Console Compilation
As an alternative to using an IDE, you can also compile source files from a terminal window as long as you have a C++ compiler. For example, on a Linux machine you can use the GNU C++ compiler, which is available on virtually all UNIX systems, including Linux and the BSD family, as part of the GNU Compiler Collection (GCC) . This compiler can also be installed on Windows by downloading MinGW or on the Mac as part of the Xcode development environment.
To use the GNU compiler, you type its name g++ in a terminal window and give it the input and output filenames as arguments. It then produces an executable file, which when run gives the same result as the one compiled under Windows in Visual Studio.
g++ MyApp.cpp -o MyApp.exe
./MyApp.exe
Hello World
Comments
Comments are used to insert notes into the source code. They have no effect on the end program and are meant only to enhance the readability of the code, both for you and for other developers. C++ has two kinds of comment notations: single-line and multi-line. The single-line comment starts with // and extends to the end of the line.
// single-line comment
The multi-line comment may span more than one line and is delimited by /* and */ .
/* multi-line
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library»

Look at similar books to C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library»

Discussion, reviews of the book C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.