B
Bill Cunningham
I have this code and it is iterating but I think I somehow somewhere
need another loop. I can get random numbers with this code but I think all
members of the array are the same random number. I want all 64 filled with a
different random number. What am I needing?
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int i, r;
char key[64];
char txt[64] = { 0 };
srand(time(NULL));
r = rand();
for (i = 0; i < 64; i++)
key = r;
printf("%d%d\n", key[0], key[1]);
}
need another loop. I can get random numbers with this code but I think all
members of the array are the same random number. I want all 64 filled with a
different random number. What am I needing?
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int i, r;
char key[64];
char txt[64] = { 0 };
srand(time(NULL));
r = rand();
for (i = 0; i < 64; i++)
key = r;
printf("%d%d\n", key[0], key[1]);
}