Smallest C++ Application
Saloni Goyal
Posted on November 7, 2020
Even though it looks deceptively simple, this is a complete program and there are a few things we can learn from it. I would encourage you to write this code in your editor and try to run it before proceeding.
- C++ is case sensitive and is partial towards lower case letters
- { and } are not ( and )
- {} are called the curly braces and () are called the round braces or parenthesis
- ; at the end of most lines of code
Compiler and Linker Errors
The compiler assumes you are trying to make sense. Error messages can sometimes be misleading and difficult to understand in the beginning
As a new developer, it is best to make deliberate mistakes with this simple program, miss a semi-colon and see what happens.
- There can be both compiler and linker errors in code
- Compilers also give warnings
- Warning don't stop your application from running but they should not be ignored
Don't ignore warnings.
Sometimes when we get multiple errors, it is best to fix the first one and compile again. It is likely that the first error is causing the others.
Please leave out comments with anything you don't understand or would like for me to improve upon.
Thanks for reading!
Posted on November 7, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.