Short Note on Scope Resolution Operator in c++

No comments


Scope Resolution Operator :-  
                                                                      This operator can be used in situations where a global variable exist with the same name as a local variable.

Example :- 

#include <stdio.h>
int  xyz=50;  // global variable
int main ()
{
              for(register int xyz=1;xyz<10;xyz++)
               // Here xyz is local variable
{
      printf(“%d,::xyz/xyz”); //local variable
}
returnno();
}

In this code fragment the scope resolution operator is used to address a global variable instead of the local variable with the same name.



No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀