Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 01067627 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

Merge branch 'intro_notebooks' into 'master'

Really is !75; I made a false operation that removed it unduly

See merge request !94
parents dfcafe33 45d85933
No related branches found
No related tags found
1 merge request!94Really is !75; I made a false operation that removed it unduly
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# [Getting started in C++](./) - [A brief introduction](./0-introduction-to-C++.ipynb) # [Getting started in C++](./) - [A brief introduction](./0-introduction-to-C++.ipynb)
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
<h1>Table of Contents<span class="tocSkip"></span></h1> <h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#A-very-brief-historic" data-toc-modified-id="A-very-brief-historic-1">A very brief historic</a></span></li><li><span><a href="#Which-standard-will-be-tackled-in-this-lecture?" data-toc-modified-id="Which-standard-will-be-tackled-in-this-lecture?-2">Which standard will be tackled in this lecture?</a></span><ul class="toc-item"><li><span><a href="#C++-11/14/17-rather-than-C++-98/03" data-toc-modified-id="C++-11/14/17-rather-than-C++-98/03-2.1">C++ 11/14/17 rather than C++ 98/03</a></span></li><li><span><a href="#But-which-one-should-you-use?-11,-14-or-17?" data-toc-modified-id="But-which-one-should-you-use?-11,-14-or-17?-2.2">But which one should you use? 11, 14 or 17?</a></span></li><li><span><a href="#And-C++-20?" data-toc-modified-id="And-C++-20?-2.3">And C++ 20?</a></span></li></ul></li><li><span><a href="#A-multi-paradigm-language" data-toc-modified-id="A-multi-paradigm-language-3">A multi-paradigm language</a></span></li></ul></div> <div class="toc"><ul class="toc-item"><li><span><a href="#A-very-brief-historic" data-toc-modified-id="A-very-brief-historic-1">A very brief historic</a></span></li><li><span><a href="#Which-standard-will-be-tackled-in-this-lecture?" data-toc-modified-id="Which-standard-will-be-tackled-in-this-lecture?-2">Which standard will be tackled in this lecture?</a></span><ul class="toc-item"><li><span><a href="#C++-11/14/17-rather-than-C++-98/03" data-toc-modified-id="C++-11/14/17-rather-than-C++-98/03-2.1">C++ 11/14/17 rather than C++ 98/03</a></span></li><li><span><a href="#But-which-one-should-you-use?-11,-14-or-17?" data-toc-modified-id="But-which-one-should-you-use?-11,-14-or-17?-2.2">But which one should you use? 11, 14 or 17?</a></span></li><li><span><a href="#And-C++-20?" data-toc-modified-id="And-C++-20?-2.3">And C++ 20?</a></span></li></ul></li><li><span><a href="#A-multi-paradigm-language" data-toc-modified-id="A-multi-paradigm-language-3">A multi-paradigm language</a></span></li></ul></div>
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## A very brief historic ## A very brief historic
- C++ was first published in 1985 by Bjarne Stroustrup with the idea of extending C with object programming; the first name of the language was _C with classes_ - C++ was first published in 1985 by Bjarne Stroustrup with the idea of extending C with object programming; the first name of the language was _C with classes_
- The first standard was issued in 1998 and called _C++ 98_ - The first standard was issued in 1998 and called _C++ 98_
- A first (minor) update was issued in 2003 (and dubbed *C++ 03*) - A first (minor) update was issued in 2003 (and dubbed *C++ 03*)
- The plan was to provide a major overhaul for the next version, which was called for a long time *C++ 0x*. - The plan was to provide a major overhaul for the next version, which was called for a long time *C++ 0x*.
- The schedule failed, as the next standard turned out to be *C++ 11*. It is a major update, with lots of new features and syntactic sugar introduced. - The schedule failed, as the next standard turned out to be *C++ 11*. It is a major update, with lots of new features and syntactic sugar introduced.
- The plan was now to publish a release every three years, alternating minor and major ones. The committee followed the planned schedule more successfully than for *C++ 0x*, except for the minor/major: - The plan was now to publish a release every three years, alternating minor and major ones. The committee followed the planned schedule more successfully than for *C++ 0x*, except for the minor/major:
* *C++ 14* was a polishing of *C++ 11*, as intended. * *C++ 14* was a polishing of *C++ 11*, as intended.
* *C++ 17* introduced more new stuff than *C++ 14*, but not as many as initially intended. * *C++ 17* introduced more new stuff than *C++ 14*, but not as many as initially intended.
* *C++ 20* is a major update, almost as groundbreaking as *C++ 11*. * *C++ 20* is a major update, almost as groundbreaking as *C++ 11*.
* *C++ 23* has been finalized in February 2023; but many features from both language and standard library aren't supported yet by compilers.
* *C++ 26* is under discussed and some of the features are already available.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Which standard will be tackled in this lecture? ## Which standard will be tackled in this lecture?
### C++ 11/14/17 rather than C++ 98/03 ### C++ 11/14/17 rather than C++ 98/03
The new major standard is now widely supported by compilers, and introduces many features that are very useful. As it is much more pleasant to use, it would be a shame to restrict ourselves to the older versions of the standard. The new major standard is now widely supported by compilers, and introduces many features that are very useful. As it is much more pleasant to use, it would be a shame to restrict ourselves to the older versions of the standard.
However, you may have to tackle legacy code which is written in C++ 98/03, so we indicated as much as possible for each recent feature presented when it was actually introduced (if not specified assume it was already present in C++ 98). However, you may have to tackle legacy code which is written in C++ 98/03, so we indicated as much as possible for each recent feature presented when it was actually introduced (if not specified assume it was already present in C++ 98).
### But which one should you use? 11, 14 or 17? ### But which one should you use? 11, 14 or 17?
As indicated above, we tried to specify clearly in which standard specific features were introduced. Few guidelines: As indicated above, we tried to specify clearly in which standard specific features were introduced. Few guidelines:
- C++ 14 is now a safe bet for most compilers, so you should probably choose this one instead of C++ 11. Vincent is working on a library named [Gudhi](https://gudhi.inria.fr/) that is rather conservative for the standard use (in the sense they want most users to be able to compile the code without having to install brand new environment) and they switched to C++ 14 in August 2019. - C++ 14 is now a safe bet for most compilers, so you should probably choose this one instead of C++ 11.
- C++ 17 support is now really widespread as well, but you may still lack some features if your distro is a bit backward (for instance default gcc compiler on still supported Ubuntu LTS 18.04 does not support the brand new filesystem library (yes C++ was not historically a _batteries included_ language...)). - C++ 17 support is now really widespread as well, but you may still lack some features if your distro is a bit backward (for instance default gcc compiler on still supported Ubuntu LTS 18.04 does not support the brand new filesystem library (yes C++ was not historically a _batteries included_ language...)). Vincent is working on a library named [Gudhi](https://gudhi.inria.fr/) that is rather conservative for the standard use (in the sense they want most users to be able to compile the code without having to install brand new environment) and they switched to C++ 17 in December 2022.
### And C++ 20? ### And C++ 20?
C++ will not be addressed much in this lecture... essentially as we are not using it (yet).
It has been published officially at the end of 2020, but is still not widely supported by current compilers. C++ 20 will not be addressed much in this lecture... even though at least one of us (Sébastien) dabbled a lot with it since 2023.
We will obviously update this lecture when it becomes widespread, as it will introduce very cool stuff (and the promise of much better compilation errors for templates...) It has been published officially at the end of 2020, but some of its features are still not widely supported by current compilers.
We will obviously update this lecture when it becomes widespread, as it will introduce very cool stuff (and the promise of much better compilation errors for templates...). We also have a technical difficulty in that Xeus-cling technology we're using is not really maintained currently, and the issue asking whether C++ 20 support is foreseen [remains unanswered](https://github.com/jupyter-xeus/xeus-cling/issues/510) when these lines are written (February 2024), while the underlying `cling` which is used to make interpreted-like C++ support it now (see for instance [this talk](https://indico.jlab.org/event/459/contributions/11563/attachments/9696/14191/CHEP_2023_cling_Interpreting_C__20.pdf)).
### Compiler support
We will mention it again later, but [following cppreference link for compiler support](https://en.cppreference.com/w/cpp/compiler_support) is a very handy link that tells which feature is supported by which compiler.
It may help you to choose which standard to use for your project depending on the expected user of the code (can you expect your users to have fairly up-to-date OS and compilers installed? Do you plan your code to be used only in a specific environment, or must it be cross-platform? etc...)
Don't worry we will tackle that again at the end of this training session, but if you intend to use C++ fairly regularly it's a good idea to bookmark this link!
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## A multi-paradigm language ## A multi-paradigm language
C++ was originally created with the will to provide object programming to C, but it is truly now a multi-paradigm language. C++ was originally created with the will to provide object programming to C, but it is truly now a multi-paradigm language.
This lecture will cover three of them: This lecture will cover three of them:
- [Procedural programming](1-ProceduralProgramming/0-main.ipynb) - [Procedural programming](1-ProceduralProgramming/0-main.ipynb)
- [Object programming](2-ObjectProgramming/0-main.ipynb) - [Object programming](2-ObjectProgramming/0-main.ipynb)
- [Generic programming](4-Templates/0-main.ipynb) - [Generic programming](4-Templates/0-main.ipynb)
There are actually even more: functional programming for instance seems to be gaining traction at the moment and will be eased in C++ 20 standard (see \cite{Cukic2018} for more about functional programming in C++). There are actually even more: functional programming for instance seems to be gaining traction at the moment and will be eased in C++ 20 standard (see \cite{Cukic2018} for more about functional programming in C++).
This richness is not always perceived as a boon: there is a section in the [Wikipedia page](https://en.wikipedia.org/wiki/C%2B%2B#Criticism) dedicated to the criticisms addressed at C++ by notorious developers (but also a defense by Brian Kernighan!) This richness is not always perceived as a boon: there is a section in the [Wikipedia page](https://en.wikipedia.org/wiki/C%2B%2B#Criticism) dedicated to the criticisms addressed at C++ by notorious developers (but also a defense by Brian Kernighan!)
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# References # References
(<a id="cit-Cukic2018" href="#call-Cukic2018">Čukić, 2018</a>) Ivan Čukić, ``_Functional Programming in C++_'', 01 2018. (<a id="cit-Cukic2018" href="#call-Cukic2018">Čukić, 2018</a>) Ivan Čukić, ``_Functional Programming in C++_'', 01 2018.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
[© Copyright](COPYRIGHT.md) [© Copyright](COPYRIGHT.md)
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# [Getting started in C++](./) - [Getting started with the tutorial](./getting_started_with_tutorial.ipynb) # [Getting started in C++](./) - [Getting started with the tutorial](./getting_started_with_tutorial.ipynb)
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
<h1>Table of contents<span class="tocSkip"></span></h1> <h1>Table of contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#About-the-choice-of-a-Jupyter-notebook" data-toc-modified-id="About-the-choice-of-a-Jupyter-notebook-1">About the choice of a Jupyter notebook</a></span></li><li><span><a href="#When-the-notebook-is-not-enough..." data-toc-modified-id="When-the-notebook-is-not-enough...-2">When the notebook is not enough...</a></span></li><li><span><a href="#Setting-up-Jupyter" data-toc-modified-id="Setting-up-Jupyter-3">Setting up Jupyter</a></span></li><li><span><a href="#Few-guidelines-about-Jupyter" data-toc-modified-id="Few-guidelines-about-Jupyter-4">Few guidelines about Jupyter</a></span><ul class="toc-item"><li><span><a href="#Restarting-the-kernel" data-toc-modified-id="Restarting-the-kernel-4.1">Restarting the kernel</a></span></li></ul></li><li><span><a href="#Very-basic-C++-syntax-(in-notebook-and-in-general)" data-toc-modified-id="Very-basic-C++-syntax-(in-notebook-and-in-general)-5">Very basic C++ syntax (in notebook and in general)</a></span><ul class="toc-item"><li><span><a href="#Semicolons" data-toc-modified-id="Semicolons-5.1">Semicolons</a></span></li><li><span><a href="#Blocks" data-toc-modified-id="Blocks-5.2">Blocks</a></span></li><li><span><a href="#Input-/-output" data-toc-modified-id="Input-/-output-5.3">Input / output</a></span></li><li><span><a href="#Comments" data-toc-modified-id="Comments-5.4">Comments</a></span></li></ul></li></ul></div> <div class="toc"><ul class="toc-item"><li><span><a href="#About-the-choice-of-a-Jupyter-notebook" data-toc-modified-id="About-the-choice-of-a-Jupyter-notebook-1">About the choice of a Jupyter notebook</a></span></li><li><span><a href="#When-the-notebook-is-not-enough..." data-toc-modified-id="When-the-notebook-is-not-enough...-2">When the notebook is not enough...</a></span></li><li><span><a href="#Setting-up-Jupyter" data-toc-modified-id="Setting-up-Jupyter-3">Setting up Jupyter</a></span></li><li><span><a href="#Few-guidelines-about-Jupyter" data-toc-modified-id="Few-guidelines-about-Jupyter-4">Few guidelines about Jupyter</a></span><ul class="toc-item"><li><span><a href="#Restarting-the-kernel" data-toc-modified-id="Restarting-the-kernel-4.1">Restarting the kernel</a></span></li></ul></li><li><span><a href="#Very-basic-C++-syntax-(in-notebook-and-in-general)" data-toc-modified-id="Very-basic-C++-syntax-(in-notebook-and-in-general)-5">Very basic C++ syntax (in notebook and in general)</a></span><ul class="toc-item"><li><span><a href="#Semicolons" data-toc-modified-id="Semicolons-5.1">Semicolons</a></span></li><li><span><a href="#Blocks" data-toc-modified-id="Blocks-5.2">Blocks</a></span></li><li><span><a href="#Input-/-output" data-toc-modified-id="Input-/-output-5.3">Input / output</a></span></li><li><span><a href="#Comments" data-toc-modified-id="Comments-5.4">Comments</a></span></li></ul></li></ul></div>
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## About the choice of a Jupyter notebook ## About the choice of a Jupyter notebook
This notebook uses up [xeus-cling](https://xeus-cling.readthedocs.io/en/latest/), a special instance of Jupyter able to run C++ code based upon xeus (tool to build Jupyter kernels for any language) and cling (a creation from CERN to be able to run C++ as an interpreted language). This notebook uses up [xeus-cling](https://xeus-cling.readthedocs.io/en/latest/), a special instance of Jupyter able to run C++ code based upon xeus (tool to build Jupyter kernels for any language) and cling (a creation from CERN to be able to run C++ as an interpreted language).
The reasons for these choices is to really access directly to handle C++ code without the hassle of explaining how to compile and run stuff, which is an especially cumbersome way to start with this (or any really...) language. The reasons for these choices is to really access directly to handle C++ code without the hassle of explaining how to compile and run stuff, which is an especially cumbersome way to start with this (or any really...) language.
This is not to say this tutorial will ignore entirely these topics (see the dedicated [chapter](./6-InRealEnvironment/0-main.ipynb)), just that we will first focus on C++ code. However keep in mind that this notebook's fancy interpreter is not a typical C++ environment. This is not to say this tutorial will ignore entirely these topics (see the dedicated [chapter](./6-InRealEnvironment/0-main.ipynb)), just that we will first focus on C++ code. However keep in mind that this notebook's fancy interpreter is not a typical C++ environment.
Jupyter Xeus-Cling is still under active development: you should really get a recent version and keep it up-to-date. Some examples in this lecture didn't work at first and were properly dealt with with a version one month later!
## When the notebook is not enough... ## When the notebook is not enough...
As we shall see repeatedly, Xeus-cling notebooks are far from being full-proof: some stuff that are perfectly acceptable C++ aren't accepted in them, and some others required work-arounds. When such an issue appears: As we shall see repeatedly, Xeus-cling notebooks are far from being full-proof: some stuff that are perfectly acceptable C++ aren't accepted in them, and some others required work-arounds. When such an issue appears:
* It will be indicated explicitly in the notebook if a specific work around is used. We do not want you to take Jupyter work-arounds as a legit advice on how to write proper C++. * It will be indicated explicitly in the notebook if a specific work around is used. We do not want you to take Jupyter work-arounds as a legit advice on how to write proper C++.
* If Jupyter can't deal with the code, we will use [Coliru](https://coliru.stacked-crooked.com/). Coliru is a C++ online compiler; others are listed [here](https://arne-mertz.de/2017/05/online-compilers/) ([Wandbox](https://wandbox.org/) deserves a shout out as it enables testing the same code with a great variety of compiler versions). * If Jupyter can't deal with the code, we will use [Coliru](https://coliru.stacked-crooked.com/). Coliru is a C++ online compiler; others are listed [here]([GitHub page](https://arnemertz.github.io/online-compilers/)) ([Wandbox](https://wandbox.org/) deserves a shout out as it enables testing the same code with a great variety of compiler versions).
We're not sure we'll keep using Jupyter notebooks in the future: development of Xeus-cling has a bit stalled in the recent years and support of more recent versions of C++ (20 and more) is still unclear.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Few guidelines about Jupyter ## Few guidelines about Jupyter
You might not be familiar with Jupyter notebooks, so here are few tips to run it smoothly (the _Help_ menu will help you find more if you need it). You might not be familiar with Jupyter notebooks, so here are few tips to run it smoothly (the _Help_ menu will help you find more if you need it).
In a Jupyter notebook the content is divided into _cells_, in our case we are using two kind of cells: In a Jupyter notebook the content is divided into _cells_, in our case we are using two kind of cells:
* Markdown cells, such as the ones into these very words are written. * Markdown cells, such as the ones into these very words are written.
* Code cells, which are running code. In these notebooks the chosen kernel is C++17, so the code is C++17 which is interpreted by cling. * Code cells, which are running code. In these notebooks the chosen kernel is C++17, so the code is C++17 which is interpreted by cling.
There are two modes: There are two modes:
* Edit mode, in which you might change the content of a cell. In this mode the left part of the cell is in green. * Edit mode, in which you might change the content of a cell. In this mode the left part of the cell is in green.
* Command mode, in which you might take actions such as changing the type of a cell, create or delete a new one, etc... * Command mode, in which you might take actions such as changing the type of a cell, create or delete a new one, etc...
To enter in edit mode, simply type on 'Enter'. To enter in edit mode, simply type on 'Enter'.
To enter in command mode, type 'Esc'. To enter in command mode, type 'Esc'.
To execute a cell, type 'Shift + Enter'. For a markdown cell it will edit nicely the content by interpreting the markdown, and for a code cell it will run the code. To execute a cell, type 'Shift + Enter'. For a markdown cell it will edit nicely the content by interpreting the markdown, and for a code cell it will run the code.
In command mode, several handy shortcuts are there; I would recommend especially: In command mode, several handy shortcuts are there; I would recommend especially:
* `a` (add a cell above) * `a` (add a cell above)
* `b` (add a cell below) * `b` (add a cell below)
* `x` (cut a cell) * `x` (cut a cell)
* `M` (change cell mode to Markdown) * `M` (change cell mode to Markdown)
The complete list is available in _Help_ > _Keyboard_ shortcut. The complete list is available in _Help_ > _Keyboard_ shortcut.
If for some reason the code in the notebook seems stuck, you might try to restart the kernel with one of the restart option in the _Kernel_ menu. If for some reason the code in the notebook seems stuck, you might try to restart the kernel with one of the restart option in the _Kernel_ menu.
### Restarting the kernel ### Restarting the kernel
Sometimes something that should work doesn't... In this case try restarting the kernel: it might fix your issue! Sometimes something that should work doesn't... In this case try restarting the kernel: it might fix your issue!
### Table of contents ### Table of contents
The table of content for a given notebook is available as a side panel if you go to _View_ > _Table of contents_ or if you click on the third item on the leftmost panel. The table of content for a given notebook is available as a side panel if you go to _View_ > _Table of contents_ or if you click on the third item on the leftmost panel.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Very basic C++ syntax (in notebook and in general) ## Very basic C++ syntax (in notebook and in general)
### Semicolons ### Semicolons
In C++ most instructions end by a semicolon `;`. If you forget it, the underlying compiler doesn't understand the syntax. In C++ most instructions end by a semicolon `;`. If you forget it, the underlying compiler doesn't understand the syntax.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` C++17 ``` C++17
{ {
int foo = 5 // COMPILATION ERROR! int foo = 5 // COMPILATION ERROR!
} }
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` C++17 ``` C++17
{ {
int foo = 5; // OK int foo = 5; // OK
} }
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Spaces, end lines and tabulations act as word separators; utterly unreadable code as the one below is perfectly fine from the compiler standpoint: Spaces, end lines and tabulations act as word separators; utterly unreadable code as the one below is perfectly fine from the compiler standpoint:
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` C++17 ``` C++17
# include <string> # include <string>
{ {
int number ; number = 1 int number ; number = 1
; std::string name; ; std::string name;
name= name=
"truc" ; "truc" ;
number = 2 number = 2
; ;
} }
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
### Input / output ### Input / output
Inputs and outputs aren't directly a part of the language itself, but are in the standard library (often abbreviated as STL for *Standard Template Library* even if some purist may yell and explain it's not 100 % the same thing...). You therefore need to __include__ a file named `iostream`; doing so will enable the use of the input / output facilities. Inputs and outputs aren't directly a part of the language itself, but are in the standard library (often abbreviated as STL for *Standard Template Library* even if some purist may yell and explain it's not 100 % the same thing...). You therefore need to __include__ a file named `iostream`; doing so will enable the use of the input / output facilities.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` C++17 ``` C++17
{ {
std::cout << "Hello world!" << std::endl; // Should fail (unless you run a cell that includes iostream before) std::cout << "Hello world!" << std::endl; // Should fail (unless you run a cell that includes iostream before)
} }
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` C++17 ``` C++17
#include <iostream> #include <iostream>
{ {
std::cout << "Hello world!" << std::endl; // Should work: std::cout and std::endl are now known. std::cout << "Hello world!" << std::endl; // Should work: std::cout and std::endl are now known.
} }
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
- `std::cout` is the symbol to designate the standard output (i.e. your screen...) - `std::cout` is the symbol to designate the standard output (i.e. your screen...)
- `std::endl` is the symbol to clean-up the stream and go to next line. - `std::endl` is the symbol to clean-up the stream and go to next line.
The operator `<<` is used to indicate what you direct toward the stream; here `std::cout << "Hello world!"` tells to redirect the string toward the standard output. The operator `<<` is used to indicate what you direct toward the stream; here `std::cout << "Hello world!"` tells to redirect the string toward the standard output.
We will see that a bit more in detail in [a later chapter](./1-ProceduralProgramming/6-Streams.ipynb), but printing something is really helpful early on hence this brief introduction here. We will see that a bit more in detail in [a later chapter](./1-ProceduralProgramming/6-Streams.ipynb), but printing something is really helpful early on hence this brief introduction here.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
### Comments ### Comments
There are two ways to comment code in C++: There are two ways to comment code in C++:
- `//` which comments all that is after this symbol on the same line. - `//` which comments all that is after this symbol on the same line.
- `/*` ... `*/` which comments everything between the symbols. - `/*` ... `*/` which comments everything between the symbols.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` C++17 ``` C++17
{ {
int i = 0; // Everything after // is commented until the end of the line int i = 0; // Everything after // is commented until the end of the line
/* /*
commented... commented...
also commented... also commented...
*/ */
int j = 5; // no longer commented int j = 5; // no longer commented
/* /*
// This type of comment might be used inside the other style // This type of comment might be used inside the other style
*/ */
} }
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
[© Copyright](COPYRIGHT.md) [© Copyright](COPYRIGHT.md)
......
...@@ -51,7 +51,7 @@ Quick guides for each of these methods are given below. ...@@ -51,7 +51,7 @@ Quick guides for each of these methods are given below.
A link to a BinderHub instance is given at the top of the project page; foresee few minutes to set up properly the notebooks. A link to a BinderHub instance is given at the top of the project page; foresee few minutes to set up properly the notebooks.
The pro of using Binder is that you have basically nothing more to do than click on the link; the cons are the delay to create the instance, the need for an Internet connexion and the fact you won't keep locally the possible modifications you need The pro of using Binder is that you have basically nothing more to do than click on the link; the cons are the delay to create the instance, the need for an Internet connexion and the fact you won't keep locally the possible modifications you did.
### Local installation ### Local installation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment