0

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!

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Rashakil Fol
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.