0

Array merging

My homework it’s to write a fiction that merges two arrays into a 3rd one. The function must let the user decide how the third array will be display. Example: array1 [1,2,3], array2 [4,5,6]. The user should decide if array3 should display: array1, array2 or array2,array1. How can I do that? This is what I have so far but I’m not sure where to go from here. I will really appreciate the help. https://code.sololearn.com/W7jrp4f0U1ga/?ref=app

11th Jun 2018, 6:09 PM
Cheno
Cheno - avatar
14 ответов
+ 3
*ahem* you should probably not put c++ code into the css tab on a web code, just some advice
11th Jun 2018, 7:28 PM
hinanawi
hinanawi - avatar
+ 2
i attached a sample of the code i have so far
11th Jun 2018, 7:01 PM
Cheno
Cheno - avatar
+ 2
Cheno you can't just output an entire array, you have to iterate through it
11th Jun 2018, 7:45 PM
hinanawi
hinanawi - avatar
+ 2
Donna I dont think that he must sort the array. He must only join two array into one and set the joined order. Sorry if i have misunderstanded Cheno 1) You must copy your code in a C++ code not a web one 2) Its not really hard if you know pointers then i ask you know what are they? 3) Array are allocated statically or dynamically?
11th Jun 2018, 11:07 PM
KrOW
KrOW - avatar
+ 1
thanks for the advice hinanawi i just couldnt find a c++ tab on here.
11th Jun 2018, 7:35 PM
Cheno
Cheno - avatar
+ 1
thank you for helping me. ill give it a try.
11th Jun 2018, 7:54 PM
Cheno
Cheno - avatar
+ 1
thanks a lot everybody i was able to do the homework assignment. KrOW you absolutely right, i wasnt supposed to sort them out, i just had to join them together as you said before. thanks alot everybody, i really appreciate the help.
11th Jun 2018, 11:11 PM
Cheno
Cheno - avatar
0
Cheno it's alright we're all here to learn
11th Jun 2018, 7:35 PM
hinanawi
hinanawi - avatar
0
i upgraded the code, everything works but when the array3 gets printed, its all bunch of random numbers sometimes mixed with symbols.
11th Jun 2018, 7:44 PM
Cheno
Cheno - avatar
0
can you please give me an example, i just can seem to be able to do this. im getting fustrated.
11th Jun 2018, 7:46 PM
Cheno
Cheno - avatar
0
Ok go to steps... First step: create and save a c++ code in SL
11th Jun 2018, 11:18 PM
KrOW
KrOW - avatar