Hi, I'm new in D programming, and does not have much C experience either. After
reading TDPL book and playing with some sample codes, I came to decide to try
something more `practical`. I began with a Redis client binding from Hiredis C
code.
Hiredis is a small lib, and seems very simple to bind
On 01/05/2012 07:14 PM, Joshua Reusch wrote:
Am 05.01.2012 17:21, schrieb Puming Zhao:
Hi, I'm new in D programming, and does not have much C experience
either. After
reading TDPL book and playing with some sample codes, I came to decide
to try
something more `practical`. I began with a Redis
Puming Zhao wrote:
Hi, I'm new in D programming, and does not have much C experience either.
After reading TDPL book and playing with some sample codes, I came to
decide to try something more `practical`. I began with a Redis client
binding from Hiredis C code. Hiredis is a small lib, and
Am 05.01.2012 19:44, schrieb Timon Gehr:
On 01/05/2012 07:14 PM, Joshua Reusch wrote:
Am 05.01.2012 17:21, schrieb Puming Zhao:
Hi, I'm new in D programming, and does not have much C experience
either. After
reading TDPL book and playing with some sample codes, I came to decide
to try
Sure ? dlang.org says they are not:
http://www.d-programming-language.org/arrays.html#strings
Sorry, in the printf section: String literals already have a 0 appended
to them, so can be used directly
I missed this.
Hi.
Is there any way how to get MX records for given domain? I don't want to
implement whole RFC 1034/5.
I've looked at std.net.isemail, but it doesn't looks like what I need :/
Your problem is that you're calling printf on a static char array. If
you're going to use printf you have to use it on the .ptr (pointer)
field of the static array. Replace this call:
printf(Connection error: %s\n, c.errstr);
with
printf(Connection error: %s\n, c.errstr.ptr);
On my end I
Andrej Mitrovic:
I think `long long` in C is 8 bytes, which is the
equivalent to D's long type.
I think C just requires:
sizeof(long long int) = sizeof(long int).
For the actual size I think you have to ask to the C compiler.
Bye,
bearophile
how can i implementing the singleton pattern in D?
On Thu, Jan 5, 2012 at 4:15 PM, asm a...@hotmail.com wrote:
how can i implementing the singleton pattern in D?
Multithreaded or not?
both if you don't mind
On 01/05/2012 02:15 PM, asm wrote:
how can i implementing the singleton pattern in D?
Is singleton still alive? ;)
An idea is to instantiate the object in the module's static this().
Ali
On Thursday, January 05, 2012 22:15:32 asm wrote:
how can i implementing the singleton pattern in D?
The same way that you would in C++ or Java, except that unlike you have static
constructors that you can use to initialize them, and unlike both, if it's not
shared, then it's a singleton per
On Thursday, 5 January 2012 at 22:02:25 UTC, Andrej Mitrovic
wrote:
Your problem is that you're calling printf on a static char
array. If
you're going to use printf you have to use it on the .ptr
(pointer)
field of the static array. Replace this call:
printf(Connection error: %s\n,
So you have int integer; in D and long long integer; in C,
which doesn't match. I'm not sure what size long long is in
C, but I guess you need long in D?
Thanks. I've changed `int integer` to `c_long integer` according
to this page
http://dlang.org/interfaceToC.html
c_long is in
On 1/6/2012 11:38 AM, Puming wrote:
On Thursday, 5 January 2012 at 22:02:25 UTC, Andrej Mitrovic wrote:
Your problem is that you're calling printf on a static char array. If
you're going to use printf you have to use it on the .ptr (pointer)
field of the static array. Replace this call:
Here is what I've got so far:
1. long long in C is always 64bit, so in D it's long;
2. C's char* string should be converted to!string when used in
writeln;
3. String literals in D -IS- zero terminated;
And now it's working fine. Thanks everybody :)
17 matches
Mail list logo