I have this:
#include using namespace std; int main() { int a[256]; int b; int k; for (int i = 0; i < 256; i ++){
As others mentioned, use std::random_shuffle:
std::vector my_vec(256); //Reserve space for 256 numbers in advance. for(int n = 0; n < 256; ++n) { my_vec.push_back(n); } std::random_shuffle(my_vec.begin(), my_vec.end());