📄 macfix.html
字号:
<html><head>
<title>A note for Macintosh users</title></head>
<body bgcolor="#f0f0f0">
<h1>A note for Macintosh users</h1>
<a href="mailto:%20mail@nikopol.de">Nikolai Ruhe</a>
reports that if you are using MacOS X, you can use GCC to compile
your C++ programs, as follows:
<ul>
<li>
Write your source files;
</li><li>
Start the terminal application (in the Utilities folder inside the Applications folder);
</li><li>
Change to the source directory (e.g. <tt>cd</tt> <tt>src</tt>);
</li><li>
Type something such as <tt>g++</tt> <tt>myprog.cpp</tt> <tt>-o</tt> <tt>myprog</tt> <tt>-Wall</tt> to invoke the compiler.
</li></ul>
If you are using an earlier version of MacOS,
<a href="mailto:%20jnmadani@hotmail.com">Navid Madani</a>
has suggested a technique that may be useful if you are trying to get
the code from our book to work on a Macintosh.
He has tested it using the
<a href="http://www.metrowerks.com/">MetroWerks</a> CodeWarrior
compiler.
<ul>
<li>Put the line
<br><br>
<tt> #include <console.h></tt><br><br>
among the header files in your program.
The <tt>console.h</tt> header is not part of standard C++;
it is defined in the MetroWerks CodeWarrior development environment
as part of MSL (MetroWerks Standard Library).
<br><br>
</li><li>
Change the definition
<br><br>
<tt> int main()</tt><br><br>
to
<br><br>
<tt> int main(int argc, char** argv)</tt><br><br>
</li><li>
At the beginning of your program, execute the following statement:
<br><br>
<tt> argc = ccommand(&argv);</tt><br><br>
Please note that <tt>ccommand</tt> is not an inadvertent misspelling of <tt>command</tt>.
</li></ul>
If you change your program in this way, then each time you run it, it
will pop up a dialog box asking what files you want the program to use,
and giving you the opportunity to supply other options.
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -