Skip to content

Instantly share code, notes, and snippets.

View jreuben11's full-sized avatar

Josh Reuben jreuben11

View GitHub Profile
@jreuben11
jreuben11 / C++_quickref.md
Last active October 12, 2023 20:31
C++11 in a nutshell

C++11 in a nutshell

Modern C++ Coding Style

This post is based upon the standard - not supported with VC compiler ! Try these techniques using GCC / LLVM compilers and QtCreator / CLion IDEs

Avoid C programming style idioms

  • = rather than strcpy() for copying , == rather than strcmp() for comparing
  • use const , constexpr functions rather than #DEFINE, macros
  • Avoid void*, union, and raw casts (use static_cast instead)
  • use std:string instead of char*