Re: How to convert a string command line argument to an int?

2022-03-02 Thread MoonlightSentinel via Digitalmars-d-learn
On Thursday, 3 March 2022 at 07:32:24 UTC, BoQsc wrote: I tried to use `std.conv.parse(args[2])`, [...] But I'm getting this error The code doesn't declare the type to be parsed, use `parse!uint(...)`. But `to!uint` seems more appropriate for your code because `parse` ignores non-number

How to convert a string command line argument to an int?

2022-03-02 Thread BoQsc via Digitalmars-d-learn
I tried to use `std.conv.parse(args[2])`, ``` import std.stdio; import std.conv; void main(string[] args){ if (args.length > 1) { writeln(broadcastSettingChange(args[1])); if (args.length == 2) { // TODO: second argument needs parse to