Today I filled in certain gaps in my java knowledge. I wanted to start using C++ since c# is a microsoft only language. I really like how Visual stuidios looks compared to other compilers but I'm seeing that it wont compile on a mac or linux. I did some reading that it wont compile on mac, but if I code somthing in Visual studios and export the project, will it work on all platforms(windows, mac, linux)?
You can write cross-platform C++ using Visual Studio IDE (no 's') and use the Visual Studio compiler and debugger to compile and debug under windows. You'd then take the same code and use a different IDE+compiler to build and run on other platforms like linux and mac (for mac, have a look at XCode).
The main snags are:
1. Unlike java, you'll need to compile separately on each platform. Cross compilers exist but for desktop platforms aren't usually that good. For big projects you'd typically have a build machine that runs different OSs in virtual machines to do all your builds.
2. It's much harder to write cross platform C++. There are very few cross-platform apis, and even the ones that are cross platform need hand tweeking with per-platform #ifdefs (eg. BSD socket code on windows uses *slightly* different types than on linux and osx). If you go this route you'll need to either write lower level code for each platform, or use a library (such as libpng) which provides cross-platform functionality for you. Additionally, different compilers have different quirks and handle standard C++ slightly differently, meaning you have to compile and test for each platform much more.
I would be incredibly careful about heading down this route. C++ is exceptionally low level, and writing a full game requires a *lot* of system level functionality. You *will* spend at least half a year just getting a basic pong game compiling and running identically on windows/linux/mac.
What problem are you looking to solve, exactly?