struct Time
{
int days = 0;
int hours = 0;
};
void normalize(Time);
int main()
{
int i;
int n; // I realize my n is uninitialize, but I don't even know if I need n
struct Time myTime;
for (i = 0; i < n; i++) // Would 2 be better? I feel like it be wrong.
{
normalize(myTime);
}
return 0;
}
void normalize(Time timeNormalize)
{
if (timeNormalize.days > 30)
timeNormalize.days = 1;
if (timeNormalize.hours > 24)
{
timeNormalize.hours = 0;
timeNormalize.days++;
cout << timeNormalize.days, timeNormalize.hours;
}
else
timeNormalize.seconds++;
cout << timeNormalize.days, timeNormalize.hours;
}
So you know that n is uninitialised, and thus some random value, but you use it anyway? WTF?
cout << timeNormalize.days, timeNormalize.hours;
What exactly are you trying to do here? Are you trying to do this: cout << timeNormalize.days << timeNormalize.hours;
1 2 3 4
for (i = 0; i < n; i++) // Would 2 be better? I feel like it be wrong.
{
normalize(myTime);
}
What's this loop for? You just call the function on the same value over and over? Are you expecting something different to happen each time?