On Saturday, 10 December 2016 at 03:51:34 UTC, brocolis wrote:
How do I separate IP parts with dlang?
I found this very cool trick, with C++:
http://stackoverflow.com/a/5328190
Heh, I'd prefer to use sscanf vs using the streams.
On Saturday, 10 December 2016 at 13:25:13 UTC, Nicholas Wilson
wrote:
On Saturday, 10 December 2016 at 13:21:40 UTC, notna wrote:
Those statements need to be inside a function.
Feel free to post a working example or, even better, a pull
request with one ;)
On Saturday, 10 December 2016 at 13:25:13 UTC, Nicholas Wilson
wrote:
On Saturday, 10 December 2016 at 13:21:40 UTC, notna wrote:
On Saturday, 10 December 2016 at 08:03:00 UTC, biozic wrote:
[...]
Well, you know, that's one of the not so great things about
Dlang... you cannot even trust
On Saturday, 10 December 2016 at 13:21:40 UTC, notna wrote:
On Saturday, 10 December 2016 at 08:03:00 UTC, biozic wrote:
[...]
Well, you know, that's one of the not so great things about
Dlang... you cannot even trust the provided examples, if there
are any:
[...]
Those statements ne
On Saturday, 10 December 2016 at 08:03:00 UTC, biozic wrote:
This would do the same. I wouldn't say it's a trick.
import std.format : formattedRead;
import std.stdio : writefln;
string ipAddr = "192.168.1.54";
int a, b, c, d;
formattedRead(ipAddr, "%d.%d.%d.%d", &a, &b, &c,
On Saturday, 10 December 2016 at 03:51:34 UTC, brocolis wrote:
How do I separate IP parts with dlang?
I found this very cool trick, with C++:
http://stackoverflow.com/a/5328190
std::string ip ="192.168.1.54";
std::stringstream s(ip);
int a,b,c,d; //to store the 4 ints
cha
On Saturday, 10 December 2016 at 03:51:34 UTC, brocolis wrote:
How do I separate IP parts with dlang?
I found this very cool trick, with C++:
http://stackoverflow.com/a/5328190
std::string ip ="192.168.1.54";
std::stringstream s(ip);
int a,b,c,d; //to store the 4 ints
cha
How do I separate IP parts with dlang?
I found this very cool trick, with C++:
http://stackoverflow.com/a/5328190
std::string ip ="192.168.1.54";
std::stringstream s(ip);
int a,b,c,d; //to store the 4 ints
char ch; //to temporarily store the '.'
s >> a >> ch