![]() |
|
#1
|
|||
|
|||
Multi filingHello everyone!
Could anyone please explain multi-filing in c++. I did not get a bit of it. Is it necessary for the code of classes to run? I made a header file in visual basic 6.0, then when I make a C++ source file, and include class name etc., it doesn't access it, instead says 'bad path'. So could anyone please, please explain multi-filing for implementing classes, at the moment I am not very clear what it is. And how its done. |
|
#2
|
||||
|
||||
Re: Multi filingI'm assuming your talking about created header and source files. Technically it's not needed but when your projects get very large it will come in handy. Most likely what you're missing is a call to your header file. Something on the lines of #include "myheaderfile.h". This page contains a very broad range of how to create header files and why. Hope this helps.
__________________
"To argue with a person who has renounced the use of reason is like administering medicine to the dead." -Thomas Paine www.sullivan-county.com/deism.htm |
|
#3
|
||||
|
||||
Re: Multi filingAlso, make sure you have saved both your source file and header file to the same directory. Example, if my directory is c:/myproject, then I would save the files as c:/myproject/myproject.h and c:/myproject/myproject.cpp.
__________________
"How often have I said to you that when you have eliminated the impossible, whatever remains, however improbable, must be the truth?" -Sherlock Holmes |
|
#4
|
|||
|
|||
Re: Multi filingThanks dabigmooish. I am gonna read that, looks very helpful.
Thanks C++ Bandit but I did do that. Something else was wrong. |
|
#5
|
||||
|
||||
Re: Multi filingIf you're still having trouble, post your exact error message and what bit of code you think is going wrong, and we'll help you figure out what's happening.
__________________
"To argue with a person who has renounced the use of reason is like administering medicine to the dead." -Thomas Paine www.sullivan-county.com/deism.htm |
|
#6
|
|||
|
|||
Re: Multi filingI haven't read the whole article you gave the link to (I am running my programs without it), but what I've understood so far is that first you have to create a header, write the class definition in it, then open a C++ source file (for implementation) in the same workspace, write function definitions in it, and then open a new main file (of the type 'C++ source file') and write the functions in it. Right?
P.S. All of this is known as ADT isn't it? |
|
#7
|
||||
|
||||
Re: Multi filingYes, this is known as an ADT.
Don't forget to include function declarations in the header file (unless you meant that as a part of the "class definition"), don't include them in the source file. Also, are you still having trouble with your header file having a "bad path"? __________________
"How often have I said to you that when you have eliminated the impossible, whatever remains, however improbable, must be the truth?" -Sherlock Holmes |
|
#8
|
|||
|
|||
Re: Multi filingnopes, no bad path, it copies the class definition okay now.
|
|
#9
|
||||
|
||||
Re: Multi filingGreat! If you need any more help let us know!
__________________
"How often have I said to you that when you have eliminated the impossible, whatever remains, however improbable, must be the truth?" -Sherlock Holmes |
|
#10
|
|||
|
|||
Re: Multi filingI understand the main points now, implemented a few programs with ADT and they work alright. But if I do have any more problems, I'll definitely ask. Thanks a lot.
|
Recent GIDBlog
Last Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| bool problem in multi file format | pfanning | CPP / C++ Forum | 6 | 08-Mar-2008 17:45 |
| multi byte to wide char converting problem(Related to Unicode) | rajeshgalla | C Programming Language | 2 | 11-Oct-2007 07:03 |
| multi byte to wide char converting problem(Related to Unicode) | rajeshgalla | CPP / C++ Forum | 0 | 10-Oct-2007 07:14 |
| Multiply Matrix by using multi thread | ki_ki | C Programming Language | 1 | 27-Nov-2006 09:47 |
| Dynamic allocation of multi dimensional array | pointer | C Programming Language | 7 | 13-May-2005 23:50 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The