Ahoy Sailors!

So first up I do mean D & not C, I've been learning D since yesterday so I'm not quite one hundred percent on this yet, Currently I'm trying to send some text between a Client & Server script, Then execute the text in the native shell. However I get these errors.

Slave.d(20): Error: function tango.stdc.stdlib.system (char*) does not match parameter types (uint)
Slave.d(20): Error: cannot implicitly convert expression (inco) of type uint to char*

void main()

{

auto server = new Socket();  

server.connect(new InternetAddress ("127.0.0.1", 866));
while(2){
        char[1024] buf;
        auto inco = server.read(buf);
        Stdout("Received: ", buf[0..inco]).newline;
        system(inco);
        }

}

Someone else helped me on most of that (Who'd a thunk it?), Could anyone please elaborate on what's wrong?

Thanks Bye!

Ugh, Tango. Why are you using Tango?


> Currently I'm trying to send some text between a Client & Server script, Then execute the text in the native shell.

Haha, this is a terrible idea (in general).

> Slave.d(20): Error: function tango.stdc.stdlib.system (char*) does not match parameter types (uint)
Slave.d(20): Error: cannot implicitly convert expression (inco) of type uint to char*

Um, this is obviously saying that system's parameter should be a char*, not a uint.

Also, the system function expects a nul-terminated string.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.