![]() |
|
#1
|
|||
|
|||
Outputting function result to an arrayHi, I'm trying to generate a random number and output the result to the first part of an array, then a new random number to the second part etc.
Here's the code for the random number I'm using (the appropriate headers are being used too) int random_number; srand((unsigned int)time((time_t *)NULL)); random_number = (rand()%49)+1; I want to output the result of this into an array called winning[n] Any help anyone can give would be greatly appreciated! |
|||
|
#2
|
||||
|
||||
|
1st i duno how much size u need for ur winning[n] array,
so i simply assign n=49; CPP / C++ / C Code:
Last edited by dsmith : 07-May-2004 at 11:28.
Reason: Fixed highlighting
|
|
#3
|
|||
|
|||
|
thanks! I'll let you know if I can get it to work with the rest of my code (I'm not very good at this stuff)
|
|
#4
|
||||
|
||||
|
Quote:
as long as you have try it, you will get improvement at 1st everyone at here also not well at c/c++ all those things is u need more pratical the more u code, the more you will learn __________________
challenges are make life interesting, overcome them is make life meaningful. |
|
#5
|
||||
|
||||
|
Quote:
Let's simplify: CPP / C++ / C Code:
__________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Deleting elements of arrays C++ | the_crazyman | C++ Forum | 25 | 30-May-2008 08:27 |
| Help with array and function input | FearlessFife35 | C Programming Language | 13 | 16-Apr-2004 15:10 |
| Revising Script style ?????? | pepee | MySQL / PHP Forum | 4 | 14-Apr-2004 05:59 |
| Speed up C++ code about 3d array! | Truong Son | C++ Forum | 0 | 16-Mar-2004 22:52 |
| throwing an struct(with an array) through a function | knakworstje | C Programming Language | 5 | 15-Feb-2004 17:20 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The