📄 makemain.cpp
字号:
//: C18:Makemain.cpp
// From Thinking in C++, 2nd Edition
// Available at http://www.BruceEckel.com
// (c) Bruce Eckel 1999
// Copyright notice in Copyright.txt
// Create a shell main() file
#include "../require.h"
#include <fstream>
#include <strstream>
#include <cstring>
#include <cctype>
using namespace std;
int main(int argc, char* argv[]) {
requireArgs(argc, 1);
ofstream mainfile(argv[1]);
assure(mainfile, argv[1]);
istrstream name(argv[1]);
ostrstream CAPname;
char c;
while(name.get(c))
CAPname << char(toupper(c));
CAPname << ends;
mainfile << "//" << ": " << CAPname.rdbuf()
<< " -- " << endl
<< "#include <iostream>" << endl
<< endl
<< "main() {" << endl << endl
<< "}" << endl;
} ///:~
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -