Wednesday, July 10, 2019

Global Scope Resolution Operator in C++

In this article, I would like to share with you a sample program that I have learned in C++ programming about Global Scope Resolution Operator. This is very important if you are working on a C++ program especially you are dealing with advanced topics in C++ and object-oriented programming.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

scope.cpp


// Global Scope Resolution Operator in C++
// Jake R. Pomperada,MAED-IT
// July 8, 2019   8:20 PM
// Bacolod City, Negros Occidental Philippines

#include <iostream>

using namespace std;

int amt = 456;  // global variable declaration

int main()
{
int amt = 123;  // local variable declaration
cout <<"\n";
cout <<"\tGlobal Scope Resolution Operator in C++";
cout <<"\n\n";
cout << "\tDisplay Global Variable Value :" <<::amt;   // display global variable
cout <<"\n\n";
cout << "\tDisplay Local Variable Value :" << amt;   // display local variable
cout <<"\n\n";
cout <<"\tEnd of Program";
}





No comments:

Post a Comment