Creating A D DLL For Use By VB

Regan Heath regan at netwin.co.nz
Mon Mar 20 18:57:38 PST 2006


On Tue, 21 Mar 2006 02:28:53 +0000 (UTC), Rory Starkweather  
<Rory_member at pathlink.com> wrote:
> It comes back pretty quickly when you have a starting point.
>
> // uppercase.d
> import std.string;      // For uppercase
> import std.c.stdio;     // For printf
>
> int main(char[][] Args)
> {
> char cChar;         // Declare a variable (cChar) of type char
>
> if (Args.length > 1)
> {
> printf("Received %d args.\n", Args);

Don't you mean:
   printf("Received %d args.\n",Args.length);

the odd thing is, it doesn't crash without it!?

> }
>
> //uppercase returns the xth letter of the 26, capitalized.
> cChar = uppercase[12];
> // Remember to use %c for char values.
> // If you use %s for string, you get an access error.
> // This should return 'M'
> printf ("I'm hoping this will print a letter: %c\n", cChar);
> return 0;
> }

You should probably start to use writef instead of printf.

Regan



More information about the Digitalmars-d-learn mailing list