C and portability:
The basic C language is totally portable, but has very little statements. The actual power comes with the libraries. Over the years many libraries have become 'standard', e.g. stdlib, however, not all these libraries are available on all platforms and in some cases, even when they are generally available on PICs for example, they require more memory than is available on some PICs, so they have to be avoided (e.g sprintf takes a lot of flash).
If you specifically want to learn C for PICs then you are best off using the Microchip (free) IDE MPLABX and Microchip compilers and libraries - it is an integrated environment for developing a program, compiling it, flashing it onto the target PIC and, in the bigger PICs, allowing interactive debugging; set break points and look at variables, but bear in mind that depending on where you set your breakpoints, it could disturb timing.
For learning C in general, Windows Visual Studio is fine, but be aware that the various IDEs differ wildly and if you intend to primarily develop for PIC projects, then it will be better to use MPLABX and get used to that interface.
If you use MPLABX it is also useful, although not absolutely required, to get a PicKit2/3 as it integrates nicely with the IDE for programming and debugging on a PIC. My PicKit came with a development board with example programs for the various stuff on the board: ADC from a pot, several LEDs and some buttons.
Note: PICs don't have .exe files, the compiler generates a .hex file that is flashed onto the PIC and run on the PIC. MPLABX automatically builds a .hex file to program onto the PIC.
Also note that PICs run NO OPERATING system, so Linux does not enter the picture. The MPLABX IDE runs on Windows, Linux and MAC. A PIC program normally has the structure:
Code:
//Initialisation code/functions
void main(void) {
Initialise(); //calling intialisation code
while(1) { //where the program spends all its time - it is a never ending loop
......code to do what you want.....
} //end while
} //end main