Hi Guys,
sorry for asking many questions, but i'm a newby to C++.

I generated 2 dimensional array with number of rows defined by a user and number of columns set to 5. But I can't figure out how to substitute duplicating values with new unique ones.
I can't use binary search, because it will then be used for comparison with other corresponding numbers.
I'm also not quite well familiar with the shaffling. Is there a way to make it with linear search?

I would appreciate any advice.
Thanks

#include <iostream>
#include <cstdlib>
#include<iomanip>
#include<fstream>
#include <ctime>

using namespace std;

int main{

int random[7][5];
int choice;
int temp;
int results=0;

cout <<"Enter you choice\n"<<endl;
cin>> choice;
cout<<endl;

srand((unsigned)time(0)); 
int t=0;
for (;t<choice;)
{    
for(int i=0; i<1; i++)
{ 
temp = (rand()%46)+1; 
         
results = searchList(random [i],t,temp);
	if(results == -1)
	{
		temp=random[t][i];
		cout << random[t][i] << endl;
                i++;
	}
	else {
	i--;	
	}

}
t++;
}

Hello, I dunno if this helps but noticed a few things in your code:

int main{

-- Does this even compile?

for (;t<choice;)

-- What are you trying to do here?

results = searchList(random [i],t,temp);

-- I think you're trying to store "results" from a function, but, where is the function "searchList"?

:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.