Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking the C++ version on my laptop

Tags:

c++

linux

I am currently in a CS class where we use C++, and I run Linux on my laptop. So the problem is that I think I don't have the most up to date version of C++. I've read online for several commands to get the version and this is my result. Also my Linux version is 16.04, and I am compiling in my terminal

tom@TBT-XPS-13-9360:~/Documents/Subjects/CS/OOP$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There 
is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.

I don' know what part of this is my actual version of C++. If my version is not the most up to date, can someone please give me DETAILED instructions on how to do it. Still getting my Linux legs.

like image 703
Thomas Brian Tierney III Avatar asked Sep 27 '17 17:09

Thomas Brian Tierney III


People also ask

How do I know my USB-C version?

Use the Device Manager to determine if your computer has USB 1.1, 2.0, or 3.0 ports: Open the Device Manager. In the "Device Manager" window, click the + (plus sign) next to Universal Serial Bus controllers. You will see a list of the USB ports installed on your computer.

How do I know what C port my laptop has?

You can identify a USB-C PD port by just its features. First of all, it has to be a USB-C connector which is significantly different from older USB versions. It basically has rounded corners as opposed to the right-angled ones on USB-A connectors. This port and its connectors also work whichever way you plug them in.

How do I know if my laptop has Type-C charger?

If your laptop has a built-in USB-C port, then you'll be able to charge your laptop via a USB-C cable - you just have to make sure the cable has a plug adapter (the box-shaped plug at the end of your phone charger than can plug into an outlet). Some laptops, in fact, use a USB-C cable as the primary charger.


2 Answers

C++ version (Or usually called c++ standard) is different than compiler version.

g++ is your compiler, and your current version is g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

You can use different command to compile your program using different C++ version.

g++ -std=c++11 yourFile .....
g++ -std=c++14 yourFile .....

As mentioned in the comments, this version of compiler may not support c++17 features yet

like image 61
James Maa Avatar answered Oct 16 '22 19:10

James Maa


Use this command in terminal (for linux only)

cpp --version
like image 42
Akash Avatar answered Oct 16 '22 20:10

Akash