244
edits
No edit summary |
|||
| Line 9: | Line 9: | ||
==g++== | ==g++== | ||
The page [[Programming On Redbrick]] explains how to compile programs written in C++. Here we will go into more depth as to how the compiler g++ works. | The page [[Programming On Redbrick]] explains how to compile programs written in C++. Here we will go into more depth as to how the compiler g++ works. | ||
A compiler works by translating your programming language (in this case, C++) into assembly language, which is the basic language that a processor understands. While C++ is a universal language (source code written on one architecture will generally work on another unless special libraries are used), programs must be recompiled if they are to be used on different architectures - for example, if you are compiling on murphy, which uses the UltraSPARC architecture, you will have to recompile your program if you wish to use it on carbon or deathray, which use the Intel x86 architecture, because UltraSPARC and x86 assembly languages are completely different. | A compiler works by translating your programming language (in this case, C++) into assembly language, which is the basic language that a processor understands. While C++ is a universal language (source code written on one architecture will generally work on another unless special libraries are used), programs must be recompiled if they are to be used on different architectures - for example, if you are compiling on murphy, which uses the UltraSPARC architecture, you will have to recompile your program if you wish to use it on carbon or deathray, which use the Intel x86 architecture, because UltraSPARC and x86 assembly languages are completely different. | ||
| Line 409: | Line 409: | ||
a and b are passed as ''parameters'' to the add function - they are then immediately added together and the answer is returned. Experiment with this code to do different things. | a and b are passed as ''parameters'' to the add function - they are then immediately added together and the answer is returned. Experiment with this code to do different things. | ||
===More advanced C++=== | |||
I'll get around to this someday. I'm still learning too you know! | |||
[[Category:Helpdesk]] | [[Category:Helpdesk]] | ||
edits