Install GCC on CentOS 7 with YUM

Using Devtoolset-4 by Software Collections

# 1. Install a package with repository for your system:
yum install centos-release-scl

# 2. Install the collection:

yum install devtoolset-4
# or search
yum search devtoolset | grep gcc

# 3. Start using software collections:
scl enable devtoolset-4 bash

which gcc
gcc --version