473,322 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

String Reference Type

RN1
If I am not mistaken, String is reference type. Can someone please
explain me why is it reference type & not value type?
Feb 9 '08 #1
3 1015
A string can potentially contain a lot of data, and there's no telling what
size a particular string might need to be.

Therefore, not only does it make little sense to try and store a string in a
register or on the stack, or anything else you'd do with a value type,
strings have always been pointers in traditional languages.

Why would it be a value type?

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"RN1" <rn**@rediffmail.comwrote in message
news:ed**********************************@n20g2000 hsh.googlegroups.com...
If I am not mistaken, String is reference type. Can someone please
explain me why is it reference type & not value type?
Feb 9 '08 #2
RN1
On Feb 10, 3:06*am, "Jonathan Wood" <jw...@softcircuits.comwrote:
A string can potentially contain a lot of data, and there's no telling what
size a particular string might need to be.

Therefore, not only does it make little sense to try and store a string ina
register or on the stack, or anything else you'd do with a value type,
strings have always been pointers in traditional languages.

Why would it be a value type?

--
Jonathan Wood
SoftCircuits Programminghttp://www.softcircuits.com

"RN1" <r...@rediffmail.comwrote in message

news:ed**********************************@n20g2000 hsh.googlegroups.com...
If I am not mistaken, String is reference type. Can someone please
explain me why is it reference type & not value type?- Hide quoted text -

- Show quoted text -
So does it mean that data types that don't have a fixed size are
reference types & those having a fixed size are value types?

Thanks,

Ron
Feb 9 '08 #3
No, I gave two issues: Variable size was one but the potential to be large
was the other. This are two issues that are likely to make a type a
reference type.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"RN1" <rn**@rediffmail.comwrote in message
news:27**********************************@u10g2000 prn.googlegroups.com...
On Feb 10, 3:06 am, "Jonathan Wood" <jw...@softcircuits.comwrote:
A string can potentially contain a lot of data, and there's no telling
what
size a particular string might need to be.

Therefore, not only does it make little sense to try and store a string in
a
register or on the stack, or anything else you'd do with a value type,
strings have always been pointers in traditional languages.

Why would it be a value type?

--
Jonathan Wood
SoftCircuits Programminghttp://www.softcircuits.com

"RN1" <r...@rediffmail.comwrote in message

news:ed**********************************@n20g2000 hsh.googlegroups.com...
If I am not mistaken, String is reference type. Can someone please
explain me why is it reference type & not value type?- Hide quoted
text -

- Show quoted text -
So does it mean that data types that don't have a fixed size are
reference types & those having a fixed size are value types?

Thanks,

Ron

Feb 9 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: David Rubin | last post by:
I looked on google for an answer, but I didn't find anything short of using boost which sufficiently answers my question: what is a good way of doing string tokenization (note: I cannot use boost)....
7
by: Daniel | last post by:
how to make two references to one string that stay refered to the same string reguardless of the changing value in the string?
10
by: cppdev | last post by:
Hi All! I want to clear the string contents from sensitive information such as passwords, and etc. It's always a case that password will appear as string at some point or another. And i feel...
8
by: A.M | last post by:
Hi, Are string parameters in functions by refrence or by value ? Thanks, Ali
6
by: Chris Simmons | last post by:
I know that a String is immutable, but I don't understand why this piece of code fails in nUnit: // BEGIN CODE using System; class Test { public static void Main( String args )
6
by: archana | last post by:
Hi all, I am facing some wierd problem in quick watch at a time of debugging my application. I have one variable of type string, say suppose i have code as below: string FileName;...
4
by: haitao.song | last post by:
Hi, As it is always stated that value type is allocated on stack, while reference types are on managed heap. How about the struct with string members? stuct A { string str; } String type is...
26
by: Neville Lang | last post by:
Hi all, I am having a memory blank at the moment. I have been writing in C# for a number of years and now need to do something in VB.NET, so forgive me such a primitive question. In C#, I...
1
by: JRD | last post by:
Greetings, I would like to search down through the following xml string that is returned to my calling app via a webservice. What I am trying to get is the following section from the xml string ...
21
by: Ray Cassick | last post by:
I can't believe why I had not noticed this before and why I never asked it before... When defining a string why is it not required to use the new keyword? Like: Dim a As String = New String ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.