Separate names with a comma.
Discussion in 'Mac Basics and Help' started by Enix18, May 14, 2008.
Here's a simple question: How do you open C++ mode in Terminal?
What do you mean by C++ mode. The terminal is just a Unix shell.
I thought you could type a certain command to start working in C++, just like you can for Python... (I'm pretty new to this, so I really have no idea)
No, you write all the code into a file and the call the compiler to turn that into object code. The major difference is that Python is interpreted (so can be used interactively like you are describing), C++ is compiled so cannot be used interactively.
Oh, thanks for clearing that up.
You might have heard of the "C shell". When you use Terminal, you are running a Unix-style shell program. There are various shells in the world, with names like sh, bash, csh, and tcsh. bash is an extended version of sh and tcsh is an extended version of csh, and Mac OS X uses bash and tcsh but calls them sh and csh for backward compatibility reasons.
csh and tcsh are called C shells because they can execute scripts (executable text files) that use syntax similar to the C programming language. Perhaps that's what you heard about. You aren't in the real C or C++ programming langauge, however.
If you are already in Terminal, you can enter the tcsh C shell by typing
This starts a shell with a shell. To get back out to the original shell, type
Finally, if you want to, you can set your default Terminal shell to tcsh so launching Terminal will put you directly into a C shell.