Обложка канала

Библиотека C/C++ разработчика

14677 @cppproglib

Полезные материалы по всему, что может быть полезно плюсовику/сишнику.

Библиотека C/C++ разработчика

4 года назад
Открыть в
The evolution of statements with initializers in C++

In the coming two articles, we’ll see how C++ evolved in terms of writing different statements that include initializers. Simple? Boring? I don’t think so, it just shows how far we got in C++ and in programming in general in terms of readability and maintainability of code. In the first - shorter - part, we are going to cover some basics and conditionals and in the second, we’ll discuss loops. But first of all, what’s a statement? According to Wikipedia, “a statement is a syntactic unit […] that expresses some action to be carried out”. Statements can be either simple such as assignments, assertions or function calls, etc. or compound such as loops and if statements. Initialization cannot only happen in simple statements, like in an assignment, but also in compound ones. That’s probably not relevant news, but it’s also worth seeing that more and more compound statements offer options to initialize variables. Let’s see their evolution, but let’s have a glimpse of variable initialization first. Declaring a variable…

Sandor Dargo’s Blog