Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local declaration shadows the variable #5

Open
aragaer opened this issue Sep 27, 2019 · 3 comments
Open

Local declaration shadows the variable #5

aragaer opened this issue Sep 27, 2019 · 3 comments

Comments

@aragaer
Copy link

aragaer commented Sep 27, 2019

for (int year = 0, total = 0; year < years; year++)

Here you declare new total variable which is now integer and shadows the float total declaration.

@aragaer
Copy link
Author

aragaer commented Sep 27, 2019

The same issue happens for subtotal in the same function and in print_monthly_averages function.

@amluckydave
Copy link

The same issue happens for subtotal in the same function and in print_monthly_averages function.

Yep, you gonna be right.

@Alamingazipur
Copy link

for (int year = 0, total = 0; year < years; year++)

Here you declare new total variable which is now integer and shadows the float total declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants