在Windows命令提示符下,我可以键入notepad helloworld.cpp哪个将创建一个名为helloworld的.cpp文件并为我打开记事本.
Mac终端是否有类似的功能,最好使用Textmate或Textedit?
我正在使用Xcode开发工具运行Mac OS X Lion 10.7.
我试图建立一个扫雷游戏,我不断得到一个编译错误:左值作为左操作数的赋值.只有这两行:
#include <iostream>
#include <ctime>
using namespace std;
// ------------------------------------------------------
// class Cell
// represents one grid element in the Minesweeper game
// ------------------------------------------------------
class Cell {
public:
Cell();
void print();
void peek();
void unittest();
void setMined(bool);
bool getMined();
void setAdj(int);
private:
bool covered;
bool marked;
bool mined;
int adjcount;
};
// ------------------------
// functions for class Cell
// ------------------------
Cell::Cell(){
covered = true;
marked = false;
mined = false;
adjcount = 0;
// cout << "Creating a Cell" << …Run Code Online (Sandbox Code Playgroud)