h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

extern -- C# Keyword

extern -- C# Keyword

  •  The extern modifier is used to declare a method that is implemented externally.
  • A common use of the extern modifier is with the DllImport attribute when you are using Interop services to call into unmanaged code.
  • In this case, the method must also be declared as static, 

[DllImport("<dll Name>.dll")]
private static extern void <dll Method Name>();

const -- C# Keyword

const  -- C# Keyword
  • You use the const keyword to declare a constant field or a constant local.
  •  Constant fields and locals aren't variables and may not be modified.
  •  Constants can be numbers, Boolean values, strings, or a null reference.
const <Data Type> <Var Name> = <Set Value>;

Protected -- C# Keyword

Protected  -- C# Keyword:


  • The protected keyword is a member access modifier.
  • A protected member is accessible within its class and by derived class instances.

 protected <Data Type> <Variable Name>;