On 12/23/20 3:23 PM, Godnyx wrote:

Any ideas?

Just fix your typos:

```D
import std : printf, toStringz;

void put(A...)(string prompt, A args) {
    static foreach (ulong i; 0..args.length) {
        static if (is(typeof(args[i]) == string))
            printf("%s\n", args[i].toStringz);
        static if (is(typeof(args[i]) == int))
            printf("%i\n", args[i]);
        static if (is(typeof(args[i]) == bool)) {
            if (args[i])
                printf("true");
            else
                printf("false");
        }
    }
}

void main() {
    put("Prompt:", "Hello, my age is: ", 19, true);
}
```

P.S. replace `arg` by `args[i]`

Reply via email to