How Many Ways Are There To Initialize An Int With A Constant?

How Many Ways Are There To Initialize An Int With A Constant?How Many Ways Are There To Initialize An Int With A Constant?

Add Comment
1 Answer(s)

There are two formats for initializers in C++ as shown in Example 1. Example 1(a) uses the traditional C notation, while Example 1(b) uses constructor notation. Many programmers do not know about the notation in Example 1(b), although they should certainly know about the first one. Many old-timer C programmers who made the switch to C++ never use the second idiom, although some wise heads of C++ profess to prefer it.

Scholar Answered on April 21, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.