digitalmars.D.learn - Best D way?
- nobody_ (6/6) Aug 12 2006 Hello,
- Frank Benoit (7/17) Aug 12 2006 I think there not a 'best' way. I can think of three ways.
Hello, What is the best way to let a function return multiple variables(of different types)? Currently I use structures for this, but making special stuctures for this can't be the best way. Thanks.
Aug 12 2006
nobody_ schrieb:Hello, What is the best way to let a function return multiple variables(of different types)? Currently I use structures for this, but making special stuctures for this can't be the best way. Thanks.I think there not a 'best' way. I can think of three ways. return a struct 'out' parameters values pointer parameter (c-style) object parameter (by reference, needs a class) If you want to return 2 int, perhaps the out is the best.
Aug 12 2006