On Saturday, 8 July 2023 at 20:01:08 UTC, H. S. Teoh wrote:
On Sat, Jul 08, 2023 at 05:15:26PM +, Cecil Ward via
Digitalmars-d-learn wrote:
I have a dynamic array of dstrings and I’m spending dstrings
to it. At one point I need to append a zero-length string just
to increase the length of t
On Sat, Jul 08, 2023 at 05:15:26PM +, Cecil Ward via Digitalmars-d-learn
wrote:
> I have a dynamic array of dstrings and I’m spending dstrings to it. At
> one point I need to append a zero-length string just to increase the
> length of the array by one but I can’t have a slot containing garbag
On Saturday, 8 July 2023 at 17:15:26 UTC, Cecil Ward wrote:
I have a dynamic array of dstrings and I’m spending dstrings to
it. At one point I need to append a zero-length string just to
increase the length of the array by one but I can’t have a slot
containing garbage. I thought about ++arr.le
On Saturday, 8 July 2023 at 17:15:26 UTC, Cecil Ward wrote:
I have a dynamic array of dstrings and I’m spending dstrings to
it. At one point I need to append a zero-length string just to
increase the length of the array by one but I can’t have a slot
containing garbage. I thought about ++arr.le
I have a dynamic array of dstrings and I’m spending dstrings to
it. At one point I need to append a zero-length string just to
increase the length of the array by one but I can’t have a slot
containing garbage. I thought about ++arr.length - would that
work, while giving me valid contents to th
On Thursday, 5 September 2013 at 16:22:46 UTC, Ali Çehreli wrote:
Compiling with "DMD64 D Compiler v2.064-devel-52cc287" produces
the following errors:
* You had byLines in your original code as well. Shouldn't it
be byLine?
* You are missing the closing brace of the foreach loop as well.
On 09/05/2013 01:14 AM, Ludovit Lucenic wrote:
I have created a wiki on this one.
http://wiki.dlang.org/Read_table_data_from_file
Compiling with "DMD64 D Compiler v2.064-devel-52cc287" produces the
following errors:
* You had byLines in your original code as well. Shouldn't it be byLine?
*
I have created a wiki on this one.
http://wiki.dlang.org/Read_table_data_from_file
On Wednesday, 4 September 2013 at 23:06:10 UTC, H. S. Teoh wrote:
The problem is that File.byLine() reuses its buffer for
efficiency, and
split is optimized to return slices into that buffer instead of
copying
each substring. So after every iteration the buffer (and
therefore the
slices into
On Thu, Sep 05, 2013 at 12:57:34AM +0200, Ludovit Lucenic wrote:
> Hello friends,
>
> with the following code
>
> import std.stdio;
> import std.array;
>
> auto file71 = File(argv[2], "r");
>
> string[][] buffer;
> foreach (line; file71.byLines) {
> buffer ~= split(line, "\t");
> }
>
> I a
Hello friends,
with the following code
import std.stdio;
import std.array;
auto file71 = File(argv[2], "r");
string[][] buffer;
foreach (line; file71.byLines) {
buffer ~= split(line, "\t");
}
I am trying to cut the lines from the file with tab as delimiter
to pre-fetch the content of a f
On Tue, 30 Dec 2008 10:56:08 -0500, Michael P.
wrote:
>Jarrett Billingsley Wrote:
>
>> On Mon, Dec 29, 2008 at 10:36 PM, Michael P. wrote:
>> > import std.stdio;
>> > import std.cstream;
>> > void main()
>> > {
>> > char[][] names;
>> > char[] currentName;
>> > while( true )
>> > {
>> >d
>Well, let's go through the code.
>
> First of all, you should undestand that an array is nothing but a pair of
> pointer to first element and its length.
>
> Since char[] == string in D1, let's use string instead to make code slightly
> more readable.
>
> string[] names; // array of strings t
On Tue, 30 Dec 2008 20:34:00 +0300, Michael P. wrote:
Denis Koroskin Wrote:
On Tue, 30 Dec 2008 20:23:07 +0300, Michael P.
wrote:
> Denis Koroskin Wrote:
>
>> On Tue, 30 Dec 2008 18:56:08 +0300, Michael P.
>> wrote:
>>
>> > Jarrett Billingsley Wrote:
>> >
>> >> On Mon, Dec 29, 2008 at
Denis Koroskin Wrote:
> On Tue, 30 Dec 2008 20:23:07 +0300, Michael P. wrote:
>
> > Denis Koroskin Wrote:
> >
> >> On Tue, 30 Dec 2008 18:56:08 +0300, Michael P.
> >> wrote:
> >>
> >> > Jarrett Billingsley Wrote:
> >> >
> >> >> On Mon, Dec 29, 2008 at 10:36 PM, Michael P.
> >> >> wrote:
> >>
On Tue, 30 Dec 2008 20:23:07 +0300, Michael P. wrote:
Denis Koroskin Wrote:
On Tue, 30 Dec 2008 18:56:08 +0300, Michael P.
wrote:
> Jarrett Billingsley Wrote:
>
>> On Mon, Dec 29, 2008 at 10:36 PM, Michael P.
>> wrote:
>> > import std.stdio;
>> > import std.cstream;
>> > void main()
>> >
Denis Koroskin Wrote:
> On Tue, 30 Dec 2008 18:56:08 +0300, Michael P. wrote:
>
> > Jarrett Billingsley Wrote:
> >
> >> On Mon, Dec 29, 2008 at 10:36 PM, Michael P.
> >> wrote:
> >> > import std.stdio;
> >> > import std.cstream;
> >> > void main()
> >> > {
> >> > char[][] names;
> >> > char
On Tue, 30 Dec 2008 18:56:08 +0300, Michael P. wrote:
Jarrett Billingsley Wrote:
On Mon, Dec 29, 2008 at 10:36 PM, Michael P.
wrote:
> import std.stdio;
> import std.cstream;
> void main()
> {
> char[][] names;
> char[] currentName;
> while( true )
> {
>din.readf( "%s", ¤tName );
>
Jarrett Billingsley Wrote:
> On Mon, Dec 29, 2008 at 10:36 PM, Michael P. wrote:
> > import std.stdio;
> > import std.cstream;
> > void main()
> > {
> > char[][] names;
> > char[] currentName;
> > while( true )
> > {
> >din.readf( "%s", ¤tName );
> >if( currentName == "stop" )
> >
On Tue, 30 Dec 2008 17:00:10 +1300, Jarrett Billingsley
wrote:
On Mon, Dec 29, 2008 at 10:53 PM, Tim M wrote:
Where is din.readf? If it is a c function then it won't be able to set
up
the dynamic array.
In std.cstream, din is an instance of std.stream.Stream bound to
standard in.
On Mon, Dec 29, 2008 at 10:53 PM, Tim M wrote:
>
> Where is din.readf? If it is a c function then it won't be able to set up
> the dynamic array.
In std.cstream, din is an instance of std.stream.Stream bound to standard in.
On Tue, 30 Dec 2008 16:36:24 +1300, Michael P.
wrote:
import std.stdio;
import std.cstream;
void main()
{
char[][] names;
char[] currentName;
while( true )
{
din.readf( "%s", ¤tName );
if( currentName == "stop" )
{
break;
}
else
{
//what goes here t
On Mon, Dec 29, 2008 at 10:36 PM, Michael P. wrote:
> import std.stdio;
> import std.cstream;
> void main()
> {
> char[][] names;
> char[] currentName;
> while( true )
> {
>din.readf( "%s", ¤tName );
>if( currentName == "stop" )
>{
> break;
>}
>else
>{
names ~= cur
import std.stdio;
import std.cstream;
void main()
{
char[][] names;
char[] currentName;
while( true )
{
din.readf( "%s", ¤tName );
if( currentName == "stop" )
{
break;
}
else
{
//what goes here to dynamically allocate memory for the
//names array? n
24 matches
Mail list logo