![]() |
| | #1 |
| Registered User Join Date: Mar 2009
Posts: 1
| Creating a Spreadsheet using a multidimensional array The program pretty much calls for the person to make a spread sheet like in excel. The main problems I have with it is I dunno how write the proper input so I can access certain cells of the array and put information into them, I don't want the program code written so much as I want a basic example on how to take a two dimensional array and be able to access the the elements of the array in program and change the values within those elements so I can type in on the cosole "A1= 3" and have the array element that has A1 in it be changed to 3 Last edited by Apiatan; 03-21-2009 at 04:02 PM. |
| Apiatan is offline | |
| | #2 |
| and the Hat of Guessing Join Date: Nov 2007
Posts: 8,814
| So that's several subproblems to work on (and working on subproblems is good, since you can solve one subproblem without worrying about the others at all): 1) Getting input 2) Deciding, given a string, what to do about it (is it an assignment, or a formula, or what) 3) Given a cell reference, how to determine what cell it refers to 4) How to store a formula in your array Using a two-dimensional array is dead simple: you give the row index and the column index and you're done. Code: int two_d_array[100][100]; two_d_array[5][8] = 4; //set the element in the sixth row and ninth column to 4 |
| tabstop is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Profiler Valgrind | afflictedd2 | C++ Programming | 4 | 07-18-2008 09:38 AM |
| Creating array of structs | knirirr | C++ Programming | 12 | 06-18-2008 08:30 AM |
| Creating a menu that reads input via an array? | Nalif | C Programming | 6 | 09-29-2006 09:21 PM |
| Creating array from data file... | Crankit211 | C Programming | 2 | 12-06-2001 09:45 PM |
| Creating an array of object pointers | Unregistered | C++ Programming | 2 | 10-08-2001 10:01 PM |