bool argument problem for random seed.

I want to generate 10 random numbers. but all numbers will be different. so I tried to
use bool first make all false. and each generate, assign that argument with bool
but someting is wrong. because outcome is not correct.

Have you had a look at this reference? It describes how to use rand and srand well.

I notice on line 9 of your program you have your array declared with 11 values. Why is this? I thought you wanted only 10?

From your description it seems as though you want to generate 10 random numbers between 1 and 10. So couldn't you just generate each number and use a couple loops and an if statement or two to check if the number has already appeared in the array? You could have the loop keep trying to generate numbers until all of them are unique.

The code above is not compiled, but it gives you a way to approach it. It might need some tweaking though.

unfortunately I dont understand your code. it seems high level. I dont know assert function and also some function is so unfamiliar for me.

what I wanted to do in my program , first I created a array of 10 items. I assigned false to each item. and later product random and changed that item to "bool true" thus trying to create unique random 10 numbers. but could not achieve it.

int random[10];
for (int i = 0; i < maxValue; i++)
{
//assing random value to random[x];
for (int x = 0; x < maxValue; x++)
{
if (random[i] == random[x])
{
//try to assign another random value
// make x = 0 again so it will check the new number with the whole array again
}
}
}

int random[10];
for (int i = 0; i < maxValue; i++)
{
//assing random value to random[x];
for (int x = 0; x < maxValue; x++)
{
if (random[i] == random[x])
{
//try to assign another random value
// make x = 0 again so it will check the new number with the whole array again
}
}
}

you are so genius. I could not even think of it. I did not compile and modify your program but the concept of the program is right.

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...