erros em printf[AJUDA]

dark777 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 8 15:30:16 PDT 2017


estava rodando este programa porem acrescentei o printf mas como 
resolver o erro?

bash-4.4$ rdmd ex3
ex3.d(19): Error: cannot pass dynamic arrays to extern(C) vararg 
functions
Failed: ["dmd", "-v", "-o-", "ex3.d", "-I."]


import std.stdio;
import std.string; //strip
import core.stdc.stdio;

//more informations: http://ddili.org/ders/d.en/strings.html

void main()
{
     //char[] name;


     write("What is your name? ");
     //readln(name); //acept vector de char on input readln
     //name = strip(name);  //Hello String!    ← no new-line 
character

     string name = readln().strip(); // read string and no new 
line strip

     write("Write Hello ", name, "!\n");
     printf("Writef Hello %s!\n", name);
     writef("Writef Hello %s!\n", name);
     writeln("Writeln Hello ", name, "!");
     writefln("Writefln Hello %s!", name);
}


More information about the Digitalmars-d-learn mailing list