Variable in C++
Thread TagsAdobe Illustrator Adobe InDesign Adobe Photoshop Android Development Android Programming Android Studio Automation Testing C / C++ Programming Career Options College Lounge css designed Design layout digital marketing Digital Marketing / SEO Fireworks Graphic Design Graphic designing Graphics Design Graphics Designing HTML? Illustrator Internship Training logo Design logo designing mobile phones Photoshop QA react-native Scroll Website SEO Single Page Website Testing Typography UI UI/UX Development UI Design UI Designing UI development User Interface UX Design Viewport Web Designing web pages Website Design
Log in with your username and password
Register for free!
Registration at Smart Mentors is completely free and takes only a few seconds. By registering you’ll gain:
- Full Posting Privileges.
- Access to Private Messaging.
- Optional Email Notification.
- Ability to Fully Participate.
- Author Replies
- January 10, 2019 at 11:54 am #51869
In c++, variables can be initialized in 2 ways, the traditional C++ initialization using “=” operator and second using the constructor notation.
Traditional C++ initilization
int i = 10;
variable i will get initialized to 10.
Using C++ constructor notation
Implicit conversions are performed when a type (say T) is used in a context where a compatible type (Say F) is expected so that the type T will be promoted to type F.
short a = 2000 + 20;
In the above example, variable a will get automatically promoted from short to int. This is called implicit conversion/coercion in c++.
You must be register. Registration is 100% free.to reply to this thread.Please or