Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7732571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:45:50+00:00 2026-06-01T06:45:50+00:00

In C#, the keywords for built-in types are simply aliases for corresponding types in

  • 0

In C#, the keywords for built-in types are simply aliases for corresponding types in the System namespace.

Generally, it makes no difference whether you use a keyword (such as int) or an identifier (such as Int32) to refer to a built-in type. But there’s an exception to everything, so my question in two parts is:

  1. When does C# require you to use, or not use, a keyword?
  2. When does using a keyword instead of an identifier change the meaning of the program?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:45:51+00:00Added an answer on June 1, 2026 at 6:45 am

    A using alias directive cannot use a keyword as the type name (but can use keywords in type argument lists):

    using Handle = int; // error
    using Handle = Int32; // OK
    using NullableHandle = Nullable<int>; // OK
    

    The underlying type of an enum must be specified using a keyword:

    enum E : int { } // OK
    enum E : Int32 { } // error
    

    The expressions (x)+y, (x)-y, and (x)*y are interpreted differently depending on whether x is a keyword or an identifier:

    (int)+y // cast +y (unary plus) to int
    (Int32)+y // add y to Int32; error if Int32 is not a variable
    (Int32)(+y) // cast +y to Int32
    
    (int)-y // cast -y (unary minus) to int
    (Int32)-y // subtract y from Int32; error if Int32 is not a variable
    (Int32)(-y) // cast -y to Int32
    
    (int)*y // cast *y (pointer indirection) to int
    (Int32)*y // multiply Int32 by y; error if Int32 is not a variable
    (Int32)(*y) // cast *y to Int32
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

MS Visual Studio editor highlights some non-keyword identifiers as keywords in C++ files. Particularly
I know visual studio has some magic keywords you can use in comments, which
With F# it is my understanding that you can use the inline keyword to
Are the keywords used for project, target, task, function, ... in NAnt build files
Java allows for certain keywords to be followed by a statement or a statement
I realize that keywords and descriptions are old-school SEO techniques and many search engines
I have a Keywords table with the fields KeywordsEn and KeywordsFr. I have another
Two new keywords added to the C# 5.0 language are async and await ,
I have a confusion between two B keywords. The official B reference manual uses
I probably don't know the keywords to search, and am not able to google

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.