February 01, 2006
Walter Bright wrote:
> 
> For some more thoughts on this, see www.digitalmars.com/d/cppstrings.html.
> 


There's a doc bug inn "Filling a string":

	char[] str = "hello";
	str[1..2] = '?';		// str is "h??lo"

str is "h?llo" and not "h??lo". Dunno if there is a problem too with the C++ example.


-- 
Bruno Medeiros - CS/E student
"Certain aspects of D are a pathway to many abilities some consider to be... unnatural."
February 01, 2006
On Wed, 01 Feb 2006 13:49:57 +0000, Bruno Medeiros wrote:

> Walter Bright wrote:
>> 
>> For some more thoughts on this, see www.digitalmars.com/d/cppstrings.html.
>> 
> 
> 
> There's a doc bug inn "Filling a string":
> 
> 	char[] str = "hello";
> 	str[1..2] = '?';		// str is "h??lo"
> 
> str is "h?llo" and not "h??lo". Dunno if there is a problem too with the C++ example.

Hi, I have another example for that, but same problem, somehow the end index is the real end index+1. I thought it was implemented like that in the language, so that if you wanted to fill the complete array you would do:

str[0..length]='?'.



February 02, 2006
You're right, I'll fix it.


1 2 3
Next ›   Last »