Re: Translation of C function pointer.

2010-09-16 Thread Kagamin
BCS Wrote: > The trick is that function pointers are best read from the inside out. > -- All C declarations are read from inside out, postfixes take precedence, that's why you have to use braces to give pointer higher precedence. One of the earlier books by Stroustroup gives a nice monster of a

Re: Translation of C function pointer.

2010-09-16 Thread Stewart Gordon
On 16/09/2010 15:37, Steven Schveighoffer wrote: On Thu, 16 Sep 2010 10:06:24 -0400, BCS wrote: Hello Steven, // note you can't use void as a parameter type in D void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(/*void*/); pragma(msg, typeof(xDlSym).stringof); outputs: void function

Re: Translation of C function pointer.

2010-09-16 Thread BCS
Hello Steven, On Thu, 16 Sep 2010 10:06:24 -0400, BCS wrote: Hello Steven, // note you can't use void as a parameter type in D void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(/*void*/); pragma(msg, typeof(xDlSym).stringof); outputs: void function() function(sqlite3_vfs*, void*, c

Re: FIle I/O

2010-09-16 Thread Jonathan M Davis
On Thursday, September 16, 2010 13:16:03 Kagamin wrote: > Tom Kazimiers Wrote: > > Hi Graham, > > > > On 09/16/2010 04:28 PM, Graham Nicholls wrote: > > > I'm writing a program to take a file and convert it into a binary > > > format which matches the format produced by a system which we use. If

Re: Translation of C function pointer.

2010-09-16 Thread Stewart Gordon
On 16/09/2010 15:06, BCS wrote: Hello Steven, // note you can't use void as a parameter type in D void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(/*void*/); pragma(msg, typeof(xDlSym).stringof); outputs: void function() function(sqlite3_vfs*, void*, const const(char*) zSymbol) D,

Re: FIle I/O

2010-09-16 Thread Kagamin
Tom Kazimiers Wrote: > Hi Graham, > > On 09/16/2010 04:28 PM, Graham Nicholls wrote: > > I'm writing a program to take a file and convert it into a binary format > > which > > matches the format produced by a system which we use. If I get it right, > > this > > will allow me to "replay" the fi

Re: FIle I/O

2010-09-16 Thread Nick Sabalausky
"Graham Nicholls" wrote in message news:i6t9ig$1ff...@digitalmars.com... > I'm writing a program to take a file and convert it into a binary format > which > matches the format produced by a system which we use. If I get it right, > this > will allow me to "replay" the file into the system. H

Re: FIle I/O

2010-09-16 Thread Tom Kazimiers
Graham, On 09/16/2010 05:02 PM, Graham Nicholls wrote: > Is this D 1.0 ? I get errors regarding printf - I understood that writeln was > the > 2.0 way. Yes, I think it's D 1.0. For a D 2.0 version I replaced those printf's with writeln's, too. Bye, Tom

Re: FIle I/O

2010-09-16 Thread Graham Nicholls
Is this D 1.0 ? I get errors regarding printf - I understood that writeln was the 2.0 way. Thanks

Re: FIle I/O

2010-09-16 Thread Graham Nicholls
Thanks. Not sure how I didn't find that - I'm looking now. Graham

Re: FIle I/O

2010-09-16 Thread Tom Kazimiers
Hi Graham, On 09/16/2010 04:28 PM, Graham Nicholls wrote: > I'm writing a program to take a file and convert it into a binary format which > matches the format produced by a system which we use. If I get it right, this > will allow me to "replay" the file into the system. However I can't find ho

Re: Translation of C function pointer.

2010-09-16 Thread Steven Schveighoffer
On Thu, 16 Sep 2010 10:06:24 -0400, BCS wrote: Hello Steven, // note you can't use void as a parameter type in D void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(/*void*/); pragma(msg, typeof(xDlSym).stringof); outputs: void function() function(sqlite3_vfs*, void*, const const(char

FIle I/O

2010-09-16 Thread Graham Nicholls
I'm writing a program to take a file and convert it into a binary format which matches the format produced by a system which we use. If I get it right, this will allow me to "replay" the file into the system. However I can't find how to do I/O in D. I've got the "D Programming Language" and "Tan

Re: Translation of C function pointer.

2010-09-16 Thread BCS
Hello Steven, // note you can't use void as a parameter type in D void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(/*void*/); pragma(msg, typeof(xDlSym).stringof); outputs: void function() function(sqlite3_vfs*, void*, const const(char*) zSymbol) D, now with C type un-garbleing! --