Search:

Type: Posts; User: yif611

Search: Search took 0.01 seconds.

  1. Like this? I've never used vectors before, but I...

    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...")...?



    ...
  2. Something I'd like to do next is to create a new...

    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...
  3. That seems to work, thanks!

    That seems to work, thanks!
  4. This gets me a little closer, but it looks like...

    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...
  5. Trying again: int main() { int...

    Trying again:




    int main()
    {

    int a[5] = {2, 4, 6, 8, 10};
    int i,t;
  6. Whoops. Not that. Disregard.

    Whoops. Not that. Disregard.
  7. Yes. Using the example of 2, 4, 6, 8, 10...

    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;
  8. I don't follow. Sorry. Like I said, pretty new at...

    I don't follow. Sorry. Like I said, pretty new at this.
  9. Haven't got to vectors yet. Will probably run...

    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,...
  10. Randomly shuffling an array a certain number of times then queue-ing

    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...
Results 1 to 10 of 11