GIDForums  

Go Back   GIDForums > Computer Programming Forums > CPP / C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 08-Jan-2008, 14:36
mary27 mary27 is offline
New Member
 
Join Date: Jan 2008
Posts: 4
mary27 is on a distinguished road

Help on C


Hello!
I'm somehow a beginner in C and I've got a final proj in BorlandC for which I'm supposed to design excel spreadsheet! (
the program is supposed to read data from a file, if the user wants, it should show the contents of a cell, change the content of a cell, delete a cell, or add new data thats gonna be stored in the same original file!
so as user inputs, it should understand : save 'filename', load 'filename', set cell= formula, show cell1:cell2...

is anybody here that can give me hand on this plzzz??! I'm so confused about it and I don even know how to start!
if u know somethin, plz explain it using borlandC code and preferably go by an example too to make me get it better!

thanks in advance
regards,
Mary
  #2  
Old 09-Jan-2008, 14:09
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 440
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: Help on C


This sounds a lot more difficult than a beginner program.
  #3  
Old 10-Jan-2008, 09:54
mary27 mary27 is offline
New Member
 
Join Date: Jan 2008
Posts: 4
mary27 is on a distinguished road

Re: Help on C


I know!!! and thats why I'm kinda freaked out!
well its not like I'm a pure beginner! we've done several projects up to now, but this is the hardest I've had!
have u got any suggestions for me?!
  #4  
Old 10-Jan-2008, 11:27
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 440
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: Help on C


For starters, I would try to get the GUI to look the way that you want it to. It should probably have a 2-dimensional array of edit boxes (something like CEdit in MFC). What is BorlandC? Is that for Windows or DOS?
  #5  
Old 14-Jan-2008, 07:08
mary27 mary27 is offline
New Member
 
Join Date: Jan 2008
Posts: 4
mary27 is on a distinguished road

Re: Help on C


Hey,
there's no graphics intrface goin on, everything is shown thru console window!
borlandC is for DOS!
by the way, I'm thinking of a function that given a cell's characteristic would return the row and col number!
like if I give it A23 (like in a real excel ) it will return 23 for row and 1 for col. or if I give it AB56 it'll return 56 for row and 28 for col! do u have any suggestions/idea for me?!?
  #6  
Old 14-Jan-2008, 13:17
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 440
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: Help on C


I would start with a structure that will hold everything I need for a cell. Something like:
CPP / C++ / C Code:
struct Cell
{ char Text[256];
  double Value;
  int IsEvaluated; // Does "Value" have a valid value? True or False
};
Then, you need a collection of these cells:
CPP / C++ / C Code:
#define ROWS 1024
#define COLS  1024
Cell Cells[ROWS][COLS];
Then, you'll need to write a function that loops through all of the cells and
updates the Cell's Value variable. (This is the hard part.) You might use recursion and check for never-ending loops.

Then, you'll want to write a function that prints out the table to the screen. This could also be tricky if you want to use panel/border characters to make it look good.

This may or may not be a good start. Someone else may have done something like this before and may have a better suggestion. Good luck.
  #7  
Old 15-Jan-2008, 09:54
davis
 
Posts: n/a

Re: Help on C


Quote:
Originally Posted by mary27
Hello!
I'm somehow a beginner in C and I've got a final proj in BorlandC for which I'm supposed to design excel spreadsheet! (
the program is supposed to read data from a file, if the user wants, it should show the contents of a cell, change the content of a cell, delete a cell, or add new data thats gonna be stored in the same original file!
so as user inputs, it should understand : save 'filename', load 'filename', set cell= formula, show cell1:cell2...

is anybody here that can give me hand on this plzzz??! I'm so confused about it and I don even know how to start!
if u know somethin, plz explain it using borlandC code and preferably go by an example too to make me get it better!

thanks in advance
regards,
Mary

Are you allowed to use C++? Or are you restricted to using C?


:davis:
  #8  
Old 15-Jan-2008, 13:08
mary27 mary27 is offline
New Member
 
Join Date: Jan 2008
Posts: 4
mary27 is on a distinguished road

Re: Help on C


Hi!
thanx 4 the replies!
yeah Fakepoo, this whole thing sounds so tricky and confusing for me as a beginner! but thanx 4 ur suggestions!
yeah Davis, unfortunately I'm only restricted to use C for this proj! but I don think C and C++ r that much different(other than syntax differences like for i/o, lib directories...etc), do they!?
  #9  
Old 15-Jan-2008, 13:15
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 440
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: Help on C


Quote:
Originally Posted by mary27
I don think C and C++ r that much different(other than syntax differences like for i/o, lib directories...etc), do they!?
C++ is object oriented so it allows you to create constructors/destructors and classes. You should still be able to do everything in C, some things may just be a little bit more difficult.

My suggestion for you is to get started and then show us your plan and the code that you have created and we can help you when you get stuck.
  #10  
Old 15-Jan-2008, 14:42
davis
 
Posts: n/a

Re: Help on C


Quote:
Originally Posted by mary27
yeah Davis, unfortunately I'm only restricted to use C for this proj! but I don think C and C++ r that much different(other than syntax differences like for i/o, lib directories...etc), do they!?

C++ is very much different from C. It is also discussed in a C-specific area on the forum, so you may have better luck asking C-specific coding questions in that area. There are still quite a few C programmers who do not really know C++ very well.

My point in asking you wasn't to push you to another area where it is "more proper," but to find out if you can use help that uses C++, since it is generally much easier to right robust code of the nature that you are asking using C++ instead of C. In fact, I've already got most of the code that you'd want already written in C++ and it really doesn't convert over to C very well at all due to the nature of how C and C++ are very different.

Do you know if you need to dynamically allocate (on the fly) for your cell structures or if you can make do with a statically allocated (fixed size) set of possible cells?

Also, do you know if your data type for each cell is confined to a single data type or must you be very much like Excel in that it accepts many different data types on a per-cell basis?

Do you have a sample of the kind(s) of files that you would have to be able to read and/or write using your code?


:davis:
 
 

Recent GIDBlog2nd Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:25.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.