typedefstruct Machine
{
int ActualOutput;
int ExpectedOutput;
} Output;
struct Record
{
Output Month[12]; //typedef 'struct Machine' for 12 months as an array
} a[4]; // 4 such machine's records
Without adding srand(time(0)) i get a set fixed of 96 random numbers. However if I add srand, I only have 4 sets of 24 same numbers which are different every time I compile. Please advise.
MachineType random_record()
{
int output1, output2;
for (int i = 0; i < 96; i++)
{
output1 = rand();
output2 = rand();