Haha, finally I'm right and the compiler's wrong (I hope)! Makes me feel smart :D I can't upgrade the software on this computer because it belongs to my school, but I'll re-compile it in Dev-C++...
Type: Posts; User: Kheila
Haha, finally I'm right and the compiler's wrong (I hope)! Makes me feel smart :D I can't upgrade the software on this computer because it belongs to my school, but I'll re-compile it in Dev-C++...
I checked the FAQ on this, and someone had posted this very same question before, but the solution doesn't work for me. I have a class declaration (CFract) in a header file, and under the public...
Ok, I took them out, but now I'm still getting errors saying "multiple definition of `CTime::CTime()' " like I got before I put them in the header file. What you explained makes sense, which is why I...
Yes, but I put the #ifndef etc. statements in the CTime.cpp file as well as in the header file, because otherwise it still includes the header file multiple times. This seems like it might be why it...
I thought so too, but the compiler says "`CTime' does not name a type ".
Ah, got it. It seems to be working now. There's another problem, though: in the CTime.cpp file, I need the function add() to return a value of the type CTime. Is this possible? If so, what do I need...
Hmm. That's good to know (wish that had been covered in class). It's kind of unclear exactly where to place this, here's what I did, and I know it's wrong because the compiler still doesn't like it:...
I thought I had a pretty good handle on this class thing, but once again, the compiler has humbled me. :rolleyes:
Here's what I have. There are 3 files. I made sure they're all included in the...
Yay! I finally got it! Thanks for the help, it definitely led me in the right direction. Here's what I ended up with:
void printMember(phoneNumber L[], int i)
{
if (i<10)
{
cout << " "...
Because otherwise it detaches the "(" and prints the line like this:
3. Mary Smith( 123) 456-7890
...and I don't know why. But I know that sticking the "right" in there fixes that...
Nope, doesn't work. Here's the code for the function that prints the list (the setw() parameters are fairly arbitrary):
void printMember(phoneNumber L[], int i)
{
cout << i << ". " << left <<...
I'm creating a program that gets a name and phone number from user input and puts it in a list. It starts out with a blank list, numbered 1 through 20, that looks like this:
1. ...
Because my professor told us to :)
Haha, I'll remember that. :D
Well, I tried uninstalling Dev-C++, including all configurations, and reinstalling it. Now it will compile. Strange, since I hadn't changed any major settings. Thanks for checking it out for me,...
Yup, they are in a project, I made sure.
This is really weird.
Oh, and I did try updating my Dev-C++ software. Currently I'm using version 4.9.9.2. I'm going to try downloading some different software. Maybe it'll work then.
No, I double-checked that phone.h was only in there one time. I tried creating a new project and copying the header code into a new header and the include statements plus a blank main function into a...
I wrote some code that compiles just fine in MS Visual C++ at school, but I brought it home and Dev-C++ has a problem with it. I wrote my own header called phone.h, here's the code for it:
(I put...
BTW, here's what I ended up with:
/***********************************
Lab7a.cpp
by Meghan
10/9/05
Lab 7, part one
A program that uses pointers to get
Woohoo! It works! Thanks so much for the help.
Okay, I took the first cin.get(c) out, that makes sense. I was wondering why rtrn was set to c at the end, because that part came from my instructor's pseudocode that we're supposed to model the...
We're covering pointers in my C++ class, and just got done studying functions. I'm trying to write a program that uses cin.get() to read input (yes, I know this must be a char value). The cin.get()...