Like this? I've never used vectors before, but I did a little snooping on the web.
It compiles, but I'm not sure if it's doing what I want (when I run it gives me the "Press any key...")...?
...
Type: Posts; User: yif611
Like this? I've never used vectors before, but I did a little snooping on the web.
It compiles, but I'm not sure if it's doing what I want (when I run it gives me the "Press any key...")...?
...
Something I'd like to do next is to create a new array and populate it with the outcome of this sequence. So, if I had an initial array of 5 elements, and shuffled it randomly 4 times, I'd have a...
That seems to work, thanks!
This gets me a little closer, but it looks like I'm generating some sort of weird data. It compiles and runs...oddly.
#include <iostream>
#include <algorithm>
#include <cassert>
#include...
Trying again:
int main()
{
int a[5] = {2, 4, 6, 8, 10};
int i,t;
Whoops. Not that. Disregard.
Yes. Using the example of 2, 4, 6, 8, 10 something like:
int main()
{
int a[5] = {2, 4, 6, 8, 10};
int i,t;
I don't follow. Sorry. Like I said, pretty new at this.
Haven't got to vectors yet. Will probably run into that in the fall.
What would I change, here, to put in any old set of numbers? Let's say I wanted to put the following 5 element 1D array in: 2,...
I'm a new C++ programmer, and wanted to do the following:
1. Fill a 1D array with values;
2. randomly_shuffle those values...
3. a number of times, which I'll get via cin (x number of times, an...