I have a problem... this code outputs a[] and b[] like it needs to, but it must output c[] it shows weird numbers (0x0018f.....)
basicly a and b arrays ar random, first numbers in c array ar a arrays and then goes b array numbers.... what could be my mistake?
Sorry for bad english ;(
the part when c array = a array elements goes well, but when program needs to output other part from c array where it must show b array numbers then itself outputs somekind other random numbers
example
n=4
a - 3 8 10 4
b- 5 8 9 10
c- 3 8 10 4 1638144 0 0 1 (underlined part is incorect)
Helped by putting them in code format. Always use the code format (the <> button on the bottom when posting and right when replying) when posing code helps make it easier to read.
You are writing to the same elements in c in both loops. If you want c to contain the values of a followed by the elements of b you should change the second loop. c[n + i] = b[i];
If this is the whole program you don't need to have a c array because you can just output the content of a and b directly.