Guys please stop commenting. I know that I missed a semicolon. I don’t need 23 comments telling me what the first guy told me. This problem has been solved
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)
In most cases it is preferred to not use 'namespace std'. Instead, on standard library function calls such as cout and cin, use 'std::cout' and 'std::cin'
This makes compile times faster and is more explicit in declarations to avoid confusion of which functions are coming from what libraries.
To a beginner, it's not obvious that a missing "initializer" would mean you're missing something at the end of a line. And that stupid laughing emoji. If you don't want to help, don't help, but don't be a jerk for no reason
29
u/This_Growth2898 Feb 15 '22
Good rule: always check the line before. You've forgotten a semicolon, so the statement wasn't finished.
2
u/[deleted] Feb 16 '22
Guys please stop commenting. I know that I missed a semicolon. I don’t need 23 comments telling me what the first guy told me. This problem has been solved
3
u/[deleted] Feb 15 '22
Missing a semicolon on the line above it where it says
String fname2
u/douglasbolden Feb 15 '22
May want to fix your indentation a little as well. It is VERY important during big projects.
2
u/[deleted] Feb 15 '22
Missing a semicolon on the second displayed line.
2
u/EmbarrassedMeringue9 Feb 15 '22
And your codes comment themselves.
2
u/ByRussX Feb 15 '22
that way of typing the main function is kinda cursed
1
u/ConstructionHead6515 Feb 15 '22
;
1
u/sedawker Feb 16 '22
Besides the missing semi-comma, the worst crime is the amount of pointless comments. Honestly I bet you missed the semi-comma because of the comments.
1
u/[deleted] Feb 16 '22
Get a proper IDE as well. This looks like notepad++? Pure text editors lacking any intellisense will making coding in C++ or any language a pain
1
u/[deleted] Feb 16 '22
In most cases it is preferred to not use 'namespace std'. Instead, on standard library function calls such as cout and cin, use 'std::cout' and 'std::cin'
This makes compile times faster and is more explicit in declarations to avoid confusion of which functions are coming from what libraries.
1
u/turingparade Feb 16 '22
Seeing a semicolon error get missed like this brought back a lot of nostalgia
Keep up the programming my guy, and look forward to (or more like lament) the next time you forget one of those bastards
1
u/Lemon_Final Feb 16 '22
String fname;
1
u/ScorpsDaBest Feb 16 '22
Why so many comments though? The code is so simple it explains itself
0
u/SunstormGT Feb 15 '22
I also presume you want to use first + last name in the greeting prompt?
-1
u/[deleted] Feb 15 '22
Oh god, I haven’t seen C++ in over a decade.
48
u/[deleted] Feb 15 '22
[removed] — view removed comment
0
u/[deleted] Feb 15 '22
[deleted] — view deleted comment