Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual C++
C/C++ Languages
 Context-Sensitive Keywords

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual C++ Language Reference
Context-Sensitive Keywords

Some language elements are only recognized in specific contexts. These are known as context-sensitive keywords. Outside the specific context, a context-sensitive keyword can be a user-defined symbol.

For readability purposes, you may want to limit your use of context-sensitive keywords as user–defined symbols.

The following are context-sensitive keywords:

The following sample shows that property, a context-sensitive keyword, can be used to define a property and a variable.

// context_sensitive_keywords.cpp
// compile with: /clr
public ref class C {
   int MyInt;
public:
   C() : MyInt(99) {}

   property int Property_Block {
      int get() { return MyInt; }
   }
};

int main() {
   int property = 0;
   C ^ MyC = gcnew C();
   property = MyC->Property_Block;
   System::Console::WriteLine(++property);
}
100

Compiler option: /clr

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker