Programming - C and C++
Initially created 1/20/2018 by Dr Jim Martin.
Latest update: 2/28/2021
**********************************************************************
This is the top level page that serves to provide material for
review of C and C++. Note that this material is taught in
Clemson's CPSCS 1010 and 1020. Some of the material pointed to has
been 'borrowed' from Spring 2015 offering of CPSC 1020 taught by
Dr Josh Levine.
Review of C and C++:
- Review of "C" programming concepts
- Review of "C++" programming concepts
- C++Intro
- C++Intro2
- C++Intro3
- C++Intro4
- Comments on Object Oriented
Programming and C++
- Various questions I encountered as I put this module
together
- files named as .cc or .cpp ? The convention at this
point seems to be cpp. There should be know difference
if you use cc or cpp naming conventions.
- Use of std....assumed means 'standard'. This is a
namespace that provides access to the standard library
for C++ programs.
- If you issue cout, the compiler searches the
global namespace. If you use std::cout the compiler
searches the std namespace (and finds it!).
- Argueably, best approach is to issue 'use
namespace std' at the top of your cpp file. This
adds the std namespace to the global namespace
- gcc vs g++ :
- gcc is the GNU c / c++ compiler. It compiles .c
files with a "C" compiler and .cc or .cpp files with
a C++ compiler
- g++ is the GNU C++ compiler. It compiles .c , .cc,
.cpp witha C++ compiler.
- C++ standards:
- The ISO (a specific group in the ISO referred to
as isocpp) leads
the effort to maintain and evolve the C++ standards
- The official current versions of the C++ standard
is C++-2017
- This is a good visual of
where things stand related to versions.
- On Ubuntu, we use GNU g++ - see this
page for their standards support
- To find the exact g++ version: issue : g++
--version
- This appears to work on our ubuntu 16.04 -
- g++ -dM -E -x c++ /dev/null | grep -F
__cplusplus
- And this returns with : #define
__cplusplus 199711L which I assume means
c++-2011.
- Online sources of C++ help:
- Additional sources of information that is high level
but considered very useful
Misc. Topics
Last update 2/28/2021