开发者

help! Creating a Spreadsheet using a multidimensional array c++

I have to create a simple spreadsheet program looks like this

  A B C D E F G 
0 
1 
2 
3 
4 

that can set values to cells by user input A1 24.2 ,then set the value 24.2 in A1 and store it,the same user could enter: C3 /, A1, B2 to cause the cell C3 to contain the quotient of the contents of cells A1 and B2,

i wonder know how to take a two dimensional array and be able to access the the elements of the array and开发者_如何学Python Displays the spreadsheet with all values entered or calculated the code i had so far

class SpreadSheet{
public:
    const static int nRows = 10;
    const static int nCols = 10;

    SpreadSheet();
    ofstream myFile;
    ifstream retFile;
    void displaySheet();
    void displayFileSheet(char *);
    void refreshFile();
    void inSpreadSheet();
    void setSheet(const string[nRows][nCols]);
    void setCell(int , int, string);
  string getCell(int, int);


private:
    string sheet[nRows][nCols];   
};

then i got stuck, any one


Try this instead of reinventing the wheel.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜