How many ways are there to initialize an int with a constant?

Q

How many ways are there to initialize an int with a constant?

✍: Guest

A

Two.
There are two formats for initializers in C++ as shown in the example that follows. The first format uses the traditional C notation. The second format uses constructor notation.
int foo = 123;
int bar (123);

2023-12-13, 4811👍, 1💬