www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - erros em printf[AJUDA]

reply dark777 <jeanzonta777 yahoo.com.br> writes:
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);
}
Sep 08
parent reply kinke <noone nowhere.com> writes:
On Friday, 8 September 2017 at 22:30:16 UTC, dark777 wrote:
 ex3.d(19): Error: cannot pass dynamic arrays to extern(C) 
 vararg functions
printf("Writef Hello %.*s!\n", name.length, name.ptr);
Sep 08
parent dark777 <jeanzonta777 yahoo.com.br> writes:
On Friday, 8 September 2017 at 23:04:07 UTC, kinke wrote:
 On Friday, 8 September 2017 at 22:30:16 UTC, dark777 wrote:
 ex3.d(19): Error: cannot pass dynamic arrays to extern(C) 
 vararg functions
printf("Writef Hello %.*s!\n", name.length, name.ptr);
puts por que é mais chato o printf aqui na linguagem D do que no C?
Sep 08