Go vs C++
C++ is a general-purpose programming language and widely used nowadays for competitive programming. It has imperative, object-oriented and generic programming features. C++ runs on lots of platform like Windows, Linux, Unix, Mac, etc.
Go is a procedural programming language. It was developed in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson at Google but launched in 2009 as an open-source programming language. Programs are assembled by using packages, for efficient management of dependencies. This language also supports environment adopting patterns alike to dynamic languages.
Here are some of the differences between Golang and C++ language:
| Go | C++ |
|---|---|
| Go is a procedural and concurrent programming language. | C++ is an object-oriented programming language. |
| Go does not contain classes with constructors and deconstructors. | C++ does contain classes with constructors and deconstructors. |
| Go language provides automatic garbage collection for allocating memory. | C++ language does not provide automatic garbage collection for allocating memory. |
| Go language contains pointers, but does not contain arithmetic pointer. | C++ language contains both pointers as well as arithmetic pointers. |
| In Go language, maps passed by reference. | In C++, maps passed as a value. |
| It does not use header files instead of header file go use packages. | It contain header file and does not contain package. |
| It does not support implicit type conversion. | It support implicit type conversion. |
| It does not support function overloading and also does not support user defined operators. | It support function overloading and also support user defined operators. |
| It does not support const or volatile qualifiers. | It supports const or volatile qualifiers. |
| It provides nil for invalid pointers. | It provides null or 0 for invalid pointers |
| Go use panic and recover for resolving error. | C++ use try, catch, and throw for resolving error. |
| It does not have while or do-while statements. | It have while or do-while statements. |
| It is more strong typed as comparison to C++ language. | It is less strong typed as compare to Go language. |
| Go contains goroutines and channel. | C++ does not contain goroutines and channel. |
| It does not support inheritance. | It supports inheritance. |
Recommended Posts:
- return statement in C/C++ with Examples
- Difference between Public and Private in C++ with Example
- How to implement our own Vector Class in C++?
- Web Programming in C++
- Difference between SVG and JPEG
- Difference between Linear and Non-linear Data Structures
- C++ Program to print an Array using Recursion
- Storage Classes in C++ with Examples
- fill_n() function in C++ STL with examples
- fill() function in C++ STL with examples
- Difference between Tester and SDET
- Difference between Software Testing and Embedded Testing
- Difference between Mirroring and Replication
- How to erase an element from a vector using erase() and reverse_iterator?
- iomanip setbase() function in C++ with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




