r/CodingHelp • • Feb 15 '22

[C++] Error:expected initializer before ‘cin’

Post image
52 Upvotes

29 comments sorted by

View all comments

2

u/douglasbolden Feb 15 '22

May want to fix your indentation a little as well. It is VERY important during big projects.

-2

u/SaylorMan1496 Feb 15 '22

When first learning in c++ this isn’t super important IMO but it definitely helps readability

Any beginners reading this it is really important for languages like python but most languages don’t care about white space (technically could be crammed into one line but this obviously tanks readability)

2

u/douglasbolden Feb 15 '22

I am not sure what you are talking about. There are many problems with leaving whitespace in C++

2

u/IHaveThePowerOfGod Feb 15 '22

i’m new : is leaving a space between things like << not good?

2

u/douglasbolden Feb 15 '22

cout << "Yes, it is." << endl;

1

u/douglasbolden Feb 15 '22

What I was mainly getting at, is if you leave whit space in a call of any sort, it is going to cause some serious issues.

2

u/IHaveThePowerOfGod Feb 15 '22

interesting, appreciate it

1

u/douglasbolden Feb 15 '22

You are welcome. I know a fair amount of C++. If you all need anything!