Struct/Function

Hi guys,
need help with a function, it should return a substring and position where '.' should be switched for a '#'. Can i make a struct function and make a struct return that?
Yes, returning a struct is one way of making a function return multiple values.
@Peter87
what are other ways for a function to return multiple variables?

can i also ask you to help me with this?
http://www.cplusplus.com/forum/general/160837/#msg819529
Instead of creating your own type, you could use a standard types like std::pair, or std::tuple. It's usually easier but the downside is that you don't get meaningful variable names for each of the values.

It's also possible to pass an argument by reference and have the function modify the argument instead of returning it as a return value.
Topic archived. No new replies allowed.