|
-
October 2nd, 2009, 04:19 PM
#1
Strings in C#, UNicode or ANSI?
Hi Friends!
I have some very basic, but a bit theoretical question.
How is a string in C# stored in the memory. I know it is an immutable Reference Type. OK. But the chars for the immuteable string needs to be stored anywhere in the storage, where the reference points too. How does the compiler know where the string ends. Is it terminated with '\0' or is it as I have read an ANSI string and the length of the string is stored in an integer.
In another place of the web I have read that all strings in .net (and C# is a .net language) are automatically UTF8 Format ( Unicode) which would mean that the word 'Hallo' needs 10 Bytes in the memory.
So whats behind that, or where can I find references about that.
The reason is: I simple want t get a deeper understanding of whats going on behind the scene.
Thx in before
 Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
My latest articles :
Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|