Posts

Showing posts from September, 2018

Variables in C++ - The Coding Shala

Image
Home >> Learn C++ >> Variables in C++ Variables in C++ Variables are one of the most important parts of every programming language. Variables in C++ are used to store the data that are going to use throughout the program. Every data is going to store at some memory location so variables are just the name of that memory location. Using variables in C++ we can manipulate data stored at the memory locations. These are following basic types of variable in C++ - bool char int float double void wchar_t Variable Declaration and Initialization in C++ We can declare variables in C++ at the starting of the program or anywhere in the program but must be declared before they are used. For variables declaration we have to use valid data types, based on the datatypes compiler creates storage for the variable. The syntax of variables declaration in c++ is as follows - Datatype variable_name; or  DataType variable1,variable2,..; After the decla