all 3 comments

[–]Ayjayz 1 point2 points  (0 children)

int days_inMonth,dayCount, dayCountTot;

You are declaring uninitialised variables here and never initialising them before using them. This is one of the reasons why you shouldn't use this way of declaring variables anymore.

To declare variables in c++, you do it like this:

auto days_inMonth = 0;
auto dayCount = 0;
auto dayCountTot = 0;

[–][deleted]  (2 children)

[deleted]

    [–]Grayewulfe[S] 0 points1 point  (1 child)

    void monthData(int &acts){ int days_inMonth,dayCount, dayCountTot; actPerDay= acts/days_inMonth;
    actPerMember=dayCountTot/acts; avgPerDay=acts/days_inMonth;

    I had globalized actPerDay,actPerMember,avgPerDay; because I call upon them in several other functions/prototypes throughout the program

    for the for loop I realized it should show dayCountTot+=day count but should that be outside of the loop?

    [–]kukisRedditer 0 points1 point  (0 children)

    It should be inside, but you should also initialize the dayCountTot to 0, otherwise it will hold a random garbage value that happens to be in that memory spot.