What's the difference between Visual C++ compiler and GNU GCC compiler advantages/disadvantages. If I learn to code in VC++ will it be easy to switch over to GNU?
Both Visual Studio 2010 and gcc 4.4+ are excellent (Visual Studio only slightly worse, but all failures are well-known and workarounds are available). Previous versions of Visual Studio fail in this category terribly, though.
current C++ standard (2011)
Visual Studio 2010 was very good for its year and was even ahead of GCC the moment it came out, Visual Studio 2011 implemented all of the new standard's library and even part of the future C++TR2 library, but failed to implement several key language features, ones as important as range for loops and uniform initializers
GNU GCC 4.6+ and the future 4.7.0 has almost all key language features, but is missing several important parts of the standard library.
It's hard to tell who is the clear winner here so far.
2. Portability:
GCC is the same across dozens of hardware platforms and operating systems, Visual Studio is limited to Windows OS and a couple platforms. If you're interested in this, GCC is the clear winner.
3. Optimization:
GCC has been changing its optimization strategies in the last few years so much that I lost track. I think it's safe to say they are competitive on the platforms they compete for.
4. Non-standard extensions
Visual Studio has a whole lot more language extensions than GCC, from core language changes (from "void main" to binding temporaries to non-const references) to various APIs and class libraries. If you've been relying on Microsoft extensions, you won't be able to easily transition to GNU, nor would you have a reason to. Programming in compiler-specific language dialect implies different goals from programming in standard C++.
Answers & Comments
Verified answer
There are many ways you can compare compilers
1. Standards compliance:
old C++ standards (1998 and 2003)
Both Visual Studio 2010 and gcc 4.4+ are excellent (Visual Studio only slightly worse, but all failures are well-known and workarounds are available). Previous versions of Visual Studio fail in this category terribly, though.
current C++ standard (2011)
Visual Studio 2010 was very good for its year and was even ahead of GCC the moment it came out, Visual Studio 2011 implemented all of the new standard's library and even part of the future C++TR2 library, but failed to implement several key language features, ones as important as range for loops and uniform initializers
GNU GCC 4.6+ and the future 4.7.0 has almost all key language features, but is missing several important parts of the standard library.
It's hard to tell who is the clear winner here so far.
2. Portability:
GCC is the same across dozens of hardware platforms and operating systems, Visual Studio is limited to Windows OS and a couple platforms. If you're interested in this, GCC is the clear winner.
3. Optimization:
GCC has been changing its optimization strategies in the last few years so much that I lost track. I think it's safe to say they are competitive on the platforms they compete for.
4. Non-standard extensions
Visual Studio has a whole lot more language extensions than GCC, from core language changes (from "void main" to binding temporaries to non-const references) to various APIs and class libraries. If you've been relying on Microsoft extensions, you won't be able to easily transition to GNU, nor would you have a reason to. Programming in compiler-specific language dialect implies different goals from programming in standard C++.