Smallest C++ Application

blender

Saloni Goyal

Posted on November 7, 2020

Smallest C++ Application

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.

Alt Text

  • 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

Error

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!

💖 💪 🙅 🚩
blender
Saloni Goyal

Posted on November 7, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Type Safety in Functions
cpp Type Safety in Functions

November 22, 2020

Functions in C++
cpp Functions in C++

November 21, 2020

Keyboard Input
cpp Keyboard Input

November 21, 2020

Type Safety in C++
cpp Type Safety in C++

November 20, 2020