Search:

Type: Posts; User: Kheila

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,755

    Haha, finally I'm right and the compiler's wrong...

    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++...
  2. Replies
    5
    Views
    1,755

    Friend func. and overloaded >> and

    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...
  3. Replies
    12
    Views
    6,254

    Ok, I took them out, but now I'm still getting...

    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...
  4. Replies
    12
    Views
    6,254

    Yes, but I put the #ifndef etc. statements in the...

    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...
  5. Replies
    12
    Views
    6,254

    I thought so too, but the compiler says "`CTime'...

    I thought so too, but the compiler says "`CTime' does not name a type ".
  6. Replies
    12
    Views
    6,254

    Ah, got it. It seems to be working now. There's...

    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...
  7. Replies
    12
    Views
    6,254

    Hmm. That's good to know (wish that had been...

    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:...
  8. Replies
    12
    Views
    6,254

    Linking problems, class problems

    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...
  9. Replies
    8
    Views
    8,854

    Yay! I finally got it! Thanks for the help, it...

    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 << " "...
  10. Replies
    8
    Views
    8,854

    Because otherwise it detaches the "(" and prints...

    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...
  11. Replies
    8
    Views
    8,854

    Nope, doesn't work. Here's the code for the...

    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 <<...
  12. Replies
    8
    Views
    8,854

    Formatting output into aligned columns

    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. ...
  13. Replies
    12
    Views
    2,284

    Because my professor told us to :)

    Because my professor told us to :)
  14. Replies
    12
    Views
    2,284

    Haha, I'll remember that. :D

    Haha, I'll remember that. :D
  15. Replies
    12
    Views
    2,284

    Well, I tried uninstalling Dev-C++, including all...

    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,...
  16. Replies
    12
    Views
    2,284

    Yup, they are in a project, I made sure. This...

    Yup, they are in a project, I made sure.

    This is really weird.
  17. Replies
    12
    Views
    2,284

    Oh, and I did try updating my Dev-C++ software....

    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.
  18. Replies
    12
    Views
    2,284

    No, I double-checked that phone.h was only in...

    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...
  19. Replies
    12
    Views
    2,284

    Code works in MS Visual C++, not in Dev-C++

    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...
  20. Replies
    5
    Views
    1,505

    BTW, here's what I ended up with: ...

    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
  21. Replies
    5
    Views
    1,505

    Woohoo! It works! Thanks so much for the help.

    Woohoo! It works! Thanks so much for the help.
  22. Replies
    5
    Views
    1,505

    Okay, I took the first cin.get(c) out, that makes...

    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...
  23. Replies
    5
    Views
    1,505

    Problem with pointers and functions

    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()...
Results 1 to 23 of 23