I was just about to write that.
People don't know what they want to do or don't tell clearly, it just waste time and nothing else.
The solution was suggested to you based on what you described initially. Please learn to describe the problem/issue clearly. It will save time for everyone. Please be careful in future.
Instead of generating random numbers and keeping track of whether the number has been generated previously or not, the best solution is to create an array of 100 elements, fill it with numbers from 1 to 100 and shuffle the array. There should be a direct way to do it else you can try something like (pseudo code)
for (int i =0; i < 100; i++)
int j = rand() % (i+1);
swap (arr[i], arr[j]);