But then I need to get some arrays in the function to the struct. This one below doesn't work. I didn't find any instructions what is the correct syntax. Can you make it to work for me? Thanks!
when you define an array of structs, each element will have a string first, second and third.
in your main function when youre calling your CollectSome() function youre assigning the values gathered by the function to the 10th element, but when its time to output youre outputting:
cout << output[0].first << endl;
when you want to be outputting
cout << output[10].first << endl;
secondly, in your function there is another error. your changing the values of input[0], and then returning input[10], which you havent altered yet and probably just contains some junk values. in the function you dont need to create an array of Numbers, you just need a single element. change the function back to like it was in the first example like this:
since all that arrays really are are pointers, if you pass them to a function they will always be passed by reference, so you can make the function void and just alter the elements of the array in the function.