(char* str) is not callable using argument types (string)
Zaheer Ahmed via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jul 17 07:13:52 PDT 2017
On Monday, 17 July 2017 at 14:10:39 UTC, Adam D. Ruppe wrote:
> On Monday, 17 July 2017 at 13:56:24 UTC, Zaheer Ahmed wrote:
>> I Developed OS in C and C++ but first time stuck in types.
>
> A lot of C and C++ knowledge will carry over to D, but it isn't
> exactly the same. D's strings are of type `string` which is
> another word for `immutable(char)[]`.
>
> immutable means the contents never change. A `[]` slice is a
> pointer+length pair in a single type.
>
>
> For your simple case, making it `const char*` should work...
> but you might want to read up on D's const and array types
> before going to much further.
Thank you It worked.
More information about the Digitalmars-d
mailing list