On Sunday, 26 August 2012 at 15:18:27 UTC, Timon Gehr wrote:
auto refToBigValue = (&g_bigValue)[0..1];
Thanks. Oughta read the f***ing manual instead of glancing
through it:
http://dlang.org/arrays.html
On 08/26/2012 04:19 PM, Tommi wrote:
On Saturday, 25 August 2012 at 20:58:47 UTC, Jonathan M Davis wrote:
auto buf = file.rawRead(new ubyte[](4));
Could we somehow skip making the temporary buffer, and read from the
file directly into an existing variable. Can we make a slice of one
element th
On Saturday, 25 August 2012 at 20:58:47 UTC, Jonathan M Davis
wrote:
auto buf = file.rawRead(new ubyte[](4));
Could we somehow skip making the temporary buffer, and read from
the file directly into an existing variable. Can we make a slice
of one element that points to an existing value.
im
On Sunday, August 26, 2012 01:25:04 joao wrote:
> It worked! Thanks.
> Just one more question, I and to do the reverse. Like 4132 =>
> "\x24\x10"
Use std.bitmanip.write:
http://dlang.org/phobos/std_bitmanip.html#write
- Jonathan M Davis
On Saturday, 25 August 2012 at 20:58:47 UTC, Jonathan M Davis
wrote:
On Saturday, August 25, 2012 22:49:18 joao wrote:
Ok, so I tried both ways and gave errors:
import std.stdio, std.cstream, std.system, std.bitmanip;
File f = File("filename");
auto buf = f.rawRead(new ubyte[4]);
auto i = peek!
On Saturday, August 25, 2012 22:49:18 joao wrote:
> Ok, so I tried both ways and gave errors:
> import std.stdio, std.cstream, std.system, std.bitmanip;
>
> File f = File("filename");
> auto buf = f.rawRead(new ubyte[4]);
> auto i = peek!(uint, Endian.littleEndian)(buf);
>
> std.stdio.File confli
On Saturday, 25 August 2012 at 20:31:22 UTC, Jonathan M Davis
wrote:
On Saturday, August 25, 2012 22:18:50 joao wrote:
It's not hard, sorry, it's because I'm a begginner.
So, all I wanted to do was to open a file and read the first 4
bytes and then return the int value. The last part I managed t
Am 25.08.2012 22:18, schrieb joao:
On Saturday, 25 August 2012 at 20:03:38 UTC, Jonathan M Davis wrote:
On Saturday, August 25, 2012 21:50:58 joao wrote:
Thanks everyone, I solved the problem.
I didn't understand these bitmanip methods so I searched and
found a function to do what I wanted:
st
On Saturday, August 25, 2012 22:18:50 joao wrote:
> It's not hard, sorry, it's because I'm a begginner.
> So, all I wanted to do was to open a file and read the first 4
> bytes and then return the int value. The last part I managed to
> do.
> But the first I'm trying.
>
> In Python it is something
On Saturday, 25 August 2012 at 20:03:38 UTC, Jonathan M Davis
wrote:
On Saturday, August 25, 2012 21:50:58 joao wrote:
Thanks everyone, I solved the problem.
I didn't understand these bitmanip methods so I searched and
found a function to do what I wanted:
string b = "\x24\x10\x00\x00";
uint i
On Saturday, August 25, 2012 21:50:58 joao wrote:
> Thanks everyone, I solved the problem.
> I didn't understand these bitmanip methods so I searched and
> found a function to do what I wanted:
>
> string b = "\x24\x10\x00\x00";
> uint i = byteToInt(b);
> uint byteToInt(string b) {
>return
Thanks everyone, I solved the problem.
I didn't understand these bitmanip methods so I searched and
found a function to do what I wanted:
string b = "\x24\x10\x00\x00";
uint i = byteToInt(b);
uint byteToInt(string b) {
return b[0] | b[1] << 8 | b[2] << 16 | b[3] << 24;
}
=> 4132
On Saturday, 25 August 2012 at 15:23:45 UTC, joao wrote:
Hello everyone, I recently discovered the D language.
So, I want to open a file a read 4 bytes and get the int value.
string bytes = f.read(4)
I tried to cast but give me message it was deprecated.
uint value = cast (uint) bytes
If byte
Am 25.08.2012 17:23, schrieb joao:
Hello everyone, I recently discovered the D language.
So, I want to open a file a read 4 bytes and get the int value.
string bytes = f.read(4)
I tried to cast but give me message it was deprecated.
uint value = cast (uint) bytes
If bytes was for example, "\x
On Saturday, 25 August 2012 at 15:23:45 UTC, joao wrote:
Hello everyone, I recently discovered the D language.
So, I want to open a file a read 4 bytes and get the int value.
string bytes = f.read(4)
I tried to cast but give me message it was deprecated.
uint value = cast (uint) bytes
If byte
Hello everyone, I recently discovered the D language.
So, I want to open a file a read 4 bytes and get the int value.
string bytes = f.read(4)
I tried to cast but give me message it was deprecated.
uint value = cast (uint) bytes
If bytes was for example, "\x24\x00\x00\x00" I would like to
val
16 matches
Mail list logo