DEV Community

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

Posted on • Edited on

1

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!

AWS Q Developer image

Your AI Code Assistant

Generate and update README files, create data-flow diagrams, and keep your project fully documented. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay