C++ Programming Code Examples C++ > Beginners Lab Assignments Code Examples Local Variables - in C++ programming language Local Variables - in C++ programming language Global variables are accessible in full file. But local variables are not accessible in full file. The local variable's scope is between the block of instruction that is defined between "{" and "}". Take a look on this example: int main() { { double price = 4.0, height = 5.1, length = 3.4; cout << "Price is " << price << endl; cout << "Length is " << length << endl; cout << "Height is " << height << endl; } weight = 3; //Now weight is equal to 3 cin.ignore(); return 0; }