Hello. I am a beginner at C++ and I am trying to create an Ascending and Descending order with n size. My problem is that if input higher than 6 in the size the rest of the code will not work. I don't even know what is the problem but when I try using the const int size it works. Any help would be greatly appreciated!
close but you have an order of operations issue.
what is the value of size in your new statements on line 11/12 ?
it is not defined there!
you need to read in size, THEN call new. (move the news to line 23 or so).
your do-while is a little weird as well, based off i which is modifed in the for. I think it is correct, but its 'kind of odd' way to do it.