15,908,673 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by cooljeba1 (Top 6 by date)
cooljeba1
4-Jan-11 7:59am
View
lol..
anyways.. thanks for your help.. I appriciate it..
cooljeba1
4-Jan-11 1:52am
View
Hi,
Thanks for your comments.. but yesterday I found another link please refer http://en.csharp-online.net/Value_vs_Reference
Here it shows that the address of the reference type is also stored in the stack.. only the reference type data is stored in heap ?
cooljeba1
3-Jan-11 8:56am
View
Deleted
Thanks for explaing that.. hmm this what I understand now (please correct me if I am wrong)
class c
{
public int a = 10;
}
c obj = new c();
when we create an instance the value of "a" is stored in the stack
but when we update the value
obj.a = 11;
now obj.a contains the address of "a" in the stack or obj.a will directly hold the value 11 in heap ?
cooljeba1
3-Jan-11 8:40am
View
Thanks for explaing that.. hmm this what I understand now (please correct me if I am wrong)
class c
{
public int a = 10;
}
c obj = new c();
when we create an instance the value (10) of "a" is stored in the stack
but when we update the value
obj.a = 11;
now obj.a contains the address of "a" in the stack or obj.a will directly hold the value 11 in heap ?
cooljeba1
3-Jan-11 7:31am
View
Yes I tried that.. a.GetType().tostring() displays the type as Int32 which is a value type.. But my doubt was how are they tied together.. I mean the heap and the stack ?
Thanks
cooljeba1
3-Jan-11 7:14am
View
Thanks for pointing to the article.. It pretty much explains a lot.. I did take some time to go through the article but to be frank I could understand most part except few.
One interesting point mentioned there was "An object can be referenced from stack-based local variables ".
So that's how it does ? The value types are stored in the stack and are then refrenced to the object ? So the object knows where to look for the value ?
So what happens when we use ref int c.. is int c still a value type ? or the ref keywords gets the address of the int c ?
THanks..
Show More