Returning multiple values from a function

crimaniak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 4 00:40:23 PDT 2017


On Monday, 4 September 2017 at 07:27:12 UTC, Vino.B wrote:
> Hi,
>
>  Can you help me in how to return multiple values from a 
> function, the below code is throwing an error as below

import std.stdio: writeln;
import std.typecons: tuple, Tuple;

Tuple!(int, string[]) Params () {
     return tuple(1, ["C:\\Temp\\TEAM1\\BACKUP", 
"C:\\Temp\\TEAM2\\ARCHIVE"]);
}

void main (){
     Params.writeln;
}


More information about the Digitalmars-d-learn mailing list