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 7584355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:54:02+00:00 2026-05-30T18:54:02+00:00

What is the value in memory of, for example, integer value (int) after declaration

  • 0

What is the value in memory of, for example, integer value (int) after declaration but not initialization? In “CLR vi C#” Richter writes, that value types is initialized with 0, but not allowed to be used.
So what will be in memory after declaration of variable like this

int testVar;

And how is mechanism of initializing check implemented?

  • 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-05-30T18:54:04+00:00Added an answer on May 30, 2026 at 6:54 pm

    Types are initialized with memory that is all zeros. I don’t know if this is according to the specification for all value types so you can’t count on this unless you check. For different value types zeros in memory can mean different things depending on what the type represents.

    Value types are auto initialized and can be used when they are a field of a class and not local variables. As far as I know there is no initialization check in the CLR itself. The initialization check is performed by the compiler and it reports compile time error when uninitialized variable is used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is somewhat known where .NET keeps value types in memory (mostly in stack
I have read that free() generally does not return memory to the OS. Can
I’m not sure this is the best example, but here goes. Let’s say I
What is the shortest way to fetch a value from memory in X86 Assembler?
how can i get the memory address of the value a pointer points to?
Possible Duplicate: Return value from thread I want to get the free memory of
I want to compare the current value of an in-memory Hibernate entity with the
Im curious what the exact meaning of committed memory is when the value is
I have vague memory of a screenshot of a VS plugin that colors different
Hello I have a chunk of memory (allocated with malloc()) that contains bits (bit

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.