DEV Community

Cover image for Smallest C++ Application
Saloni Goyal
Saloni Goyal

Posted on • Updated on

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!

Top comments (0)