Generating the set of all possiblities

I am trying to make a game in C for which I need to generate a set of all possible "sequence of numbers" for a given code length of the sequence and given range of digits in the sequence of numbers.

for eg : if the code length is 4 and the range is from 0 to 8

then total no. of possiblities are 9^4

I want to create a set containing all these possiblities. Any suggestions on how I should go about it?

Please bear in mind I am a beginer and started learning C just a few weeks back.

Thank You! :)
Try this out:

It will sort an array in all combinations eventually.
The program gives many errors.
Also, I dont understand the use of d fucntion used..where is it defined?
Topic archived. No new replies allowed.