![]() |
|
#1
|
|||
|
|||
Roman to decimal to romanI've been working on this for a while and need alittle help. The code is quite long so bear with me.
I'm getting an error twice: romtest.cpp error C2514: 'romanType' : class has no constructors see declaration of 'romanType' fatal error C1903: unable to recover from previous error(s); stopping compilation roman.cpp error C2514: 'romanType' : class has no constructors see declaration of 'romanType' fatal error C1903: unable to recover from previous error(s); stopping compilation roman.h CPP / C++ / C Code:
roman.cpp CPP / C++ / C Code:
romtest.cpp CPP / C++ / C Code:
Thanks Last edited by LuciWiz : 10-Feb-2005 at 06:48.
Reason: Please insert your c code between [c] & [/c] tags
|
|
#2
|
|||
|
|||
|
Quote:
Are these the only messages your compiler gave? What compiler? I ran your program through three compilers (Borland, Microsoft, GNU), and each gave hundreds of errors. There are many things to be fixed before you can get a successful compilation (let alone valid functionality). For starters, way back in roman.h: The class storage specifiers are "private" and "public", not "Private" and "Public". Here's a suggestion: instead of typing in several hundred lines of code and compiling it all at once, how about just getting in a few things to make sure you are on the right track? Get that code to execute properly, then add functionality a little at a time. For example declare your class; define a couple of simple constructors and write a test program. Here's what I have in mind. CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
1. See if these compile with your system. (I think they should; to the best of my ability and knowledge these are valid Standard C++ programs.) If something doesn't work and you don't understand why, ask specific questions. 2. Make sure you understand what they do. (There are other ways to do most of this stuff; if you want to do them some other way: go for it. Your fallback position is that you have something that you know works for you.) If you can't understand what is happening or why, ask specific questions. 3. Implement other constructors, functions and operators, adding them one at a time to your working program. Test each new thing that you put in. At each step, make sure it's working before putting in anything new. If you get errors or behavior that you don't understand, ask specific questions. (Show the code that you used; tell us what you expected; tell us what you got.) Regards, Dave |
|
#3
|
|||
|
|||
|
VS .net, I did as you said and yes the little test program compiled without a problem. I guess i'm just having a problem bringing it all together one at a time.
Spuds |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with Decimal to Hex Conversions | jediboy | C Programming Language | 1 | 13-Dec-2004 00:11 |
| Hex Result giving strange answers. | Rosdahale | C Programming Language | 6 | 07-Dec-2004 20:28 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The