Translation of C struct to D

Michael Kremser mkspamx-usenet at yahoo.de
Wed Nov 16 13:45:37 PST 2011


Am 2011-11-16 00:53, schrieb Iain Buclaw:

> Rather than using toStringz, you should be able to get by with
> declaring the register_chrdev function as follows.
>
> extern(C)
> int register_chrdev (uint major, in char *name, file_operations *fops)

This yields the following compiler error:

Error: cannot implicitly convert expression (DEVICE_NAME) of type char[] 
to char*

If I try to cast with register_chrdev(0, (char*)DEVICE_NAME, &fops); the 
following error appears:

C style cast illegal, use cast(char*)DEVICE_NAME

Best regards

Michael


More information about the Digitalmars-d mailing list