LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-28-2005, 06:27 PM   #1
purefan
Member
 
Registered: Aug 2003
Location: Sweden
Distribution: Ubuntu 10.04
Posts: 99

Rep: Reputation: Disabled
Question creation/handling of dynamic char[]s


hello!
well here I go now with another program, this is a self proyect for helping all those accounters (such as my mom) out there battling with lousy programs.
I know there might be some very good programs out there that do all that is needed, but there's nothing like a house built according to your needs and likes right?
ok, to the point:
I plan the program to allow the use of 'codes' for the clients of the current company (it will manage just one company at a time [for the time being at least]), so that it will be easier and faster to store/retrieve information.
i.e. "A001" instead of "Andy McMillian Jr"
well according to the needs: each client Will have many (if not a lot of) bills, each bill
will have information such as (Bill Number, Date, Sub-Total, Total, Taxes*, and if it is Paid already or not*2
[*:in my country the taxes are paid at the moment you buy something, some items might not pay taxes.
*2:Some companies allow credit (not like credit cards, but like trust credit)]
for this A001 would have many info to manage.
I have thought of making dinamyc arrays for each client, because new clients will show up
[so the program will have another option: "Add Client"]
so AddClient() will add the name and code to a file.
Later the user can add more (bill number, Date,...etc).
For making this idea clear, the screen might look like this:
Name:Andy McMillian Jr Code:A001
Bill Number_____Date_____Sub-Total_____Taxes_____Total_____Paid
18750__________15/2/05______754.6________75.46______830.06______YES
18751__________15/2/05______754.6________75.46______830.06______NO
...
Question:
How do I accomplish this structure of dynamic arrays and information???
or, do you have a better idea??

By the way, im using VC++6 under XP


_____________
 
Old 03-28-2005, 06:30 PM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Sounds like you'd want to use a database with a properly thought out relational schema (set of tables).
Otherwise your storage options are flat files (text or custom binary structure) or RAM while your program is running.
 
Old 03-28-2005, 06:46 PM   #3
purefan
Member
 
Registered: Aug 2003
Location: Sweden
Distribution: Ubuntu 10.04
Posts: 99

Original Poster
Rep: Reputation: Disabled
well that is a good option...if I knew how to

im going to read about databases then
any suggestions as for where to start?

Last edited by purefan; 03-28-2005 at 06:52 PM.
 
Old 03-28-2005, 08:02 PM   #4
lowpro2k3
Member
 
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
Thats a pretty big project if your not even sure where to start from a software engineering perspective. I have an assignment to finish in exactly 2 hours, 59 minutes, so when I finish I'll try to check this out later on
 
Old 03-28-2005, 08:10 PM   #5
lowpro2k3
Member
 
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
Just to let you know though, it may sound long but I program absolutely most effectively if I write a program in the following order (it HAS to be in this order! )


Desk Planning (paper/pen, thinking out the problem)
Rough Solution Draft (on paper still...) (UML-like, but not strict)
Rough Psuedocode (say 1 psuedocode statement ~= 10-20 lines of C++ code)
Rough Test Plan
Solid Draft (Strict(er) UML)
Solid Pseudocode (typed)
Solid Test Plan (typed)
Build Class 'Shells' (limited functionality)
Prototype difficult pieces of Code
Re-read psuedocode and test plan (you wrote them for a reason )
Write code
Test with test plan

while(code ! working && you ! knowing wtf to do)
{
restep through above (spending more time on some, less on others)
}



I'll admit I dont do this EVERY time, but I'm really trying to start doing it EVERY time. I've done it for my last 4 programs/assignments in various languages, and it helps TONS. Just wait till I take a software engineering course, I'll be a ninja programmer
 
Old 03-28-2005, 08:55 PM   #6
purefan
Member
 
Registered: Aug 2003
Location: Sweden
Distribution: Ubuntu 10.04
Posts: 99

Original Poster
Rep: Reputation: Disabled
LOL!! ok!
I must admit that it sounds like a really good strategy for making a very good designed program
I will wait for your answer, I think I am to learn from you hehehe
Im a student still, Im in the second programing course and I just can't enough of programing, I have so many ideas...and so little experience...
Thanks!
 
Old 03-29-2005, 03:45 AM   #7
Orkie
Member
 
Registered: Mar 2005
Distribution: Breezy Badger
Posts: 248

Rep: Reputation: 30
My don't you use sqlite to store your data? Then you don't have to worry about writing storage and recall functions for it.
 
Old 03-29-2005, 06:24 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
For programs of this type, data flow diagrams are often used in the design.

One thing to consider is that you will need to keep records for several years so using a database or spreadsheets may be a better idea than a programming solution.
 
Old 03-29-2005, 08:48 AM   #9
purefan
Member
 
Registered: Aug 2003
Location: Sweden
Distribution: Ubuntu 10.04
Posts: 99

Original Poster
Rep: Reputation: Disabled
very good then.
I will go for the database solution and following Orkie's advice I shall use sqlite. I have already downloaded it and started reading the documentation. Perhaps my next post will be something related to this subject
Thanks all for taking the time
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simplify dynamic lib creation & transportability? mattengland Programming 1 11-28-2005 02:08 AM
dynamic char, realoc os2 Programming 1 05-03-2005 07:57 AM
C Problem---convert char to char* totti10 Programming 11 11-06-2004 11:32 AM
Dynamic creation of Objects in C++ poeta_boy Programming 9 08-02-2004 01:58 PM
invalid conversion from `char' to `const char* bru Programming 6 05-09-2004 03:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration