Search:

Type: Posts; User: ryanmcclure4

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thanks, sorry about that I'll read those before I...

    Thanks, sorry about that I'll read those before I ask questions, this fixed the problem:


    csis << "Enter book title: ";
    cin.ignore(1,'\n');
  2. Alright, I've run into another little problem. ...

    Alright, I've run into another little problem. When I run the program it prints "Enter B for book, R for recording", and for example if I type 'B' and press enter it prints "Enter book title", new...
  3. I would write my own class as you said, but his...

    I would write my own class as you said, but his instructions were "Note: Please do not use the C++ String class to create any String objects in your constructors." I can't think of a reason why he...
  4. Like I said above, I can't use c++ strings; only...

    Like I said above, I can't use c++ strings; only c-style strings.
  5. When i use std::getline I still get the error. ...

    When i use std::getline I still get the error. I've never used the std:: in the body of a program before, always written the global "using namespace std;". Do I need to get rid of that if I want to...
  6. How can I initialize the char arrays when I don't...

    How can I initialize the char arrays when I don't know how long they will be?
  7. I tried both of these functions, and realized...

    I tried both of these functions, and realized that I need to use the C-strings one but my problem is that the length of the array isn't defined until runtime so I can't just write...
  8. User input to char array including white space

    Hi everyone,
    I have a program that is like a media library and has the user input titles, authors, etc. for books or recordings. What I have works so far, but when you input something with a space...
  9. Replies
    2
    Views
    2,546

    3 Overloads Have Similar Conversions

    Hi everyone,
    I overloaded the addition operator for pointer notation in my assignment and I keep getting this error when I compile:

    3 overloads have similar conversions
    could be 'char *operator...
  10. Alright thanks, good to know!

    Alright thanks, good to know!
  11. I just realized I was overloading the wrong...

    I just realized I was overloading the wrong operator (I was supposed to be overloading the assignment operator for this part of my assignment) and changed it - now it works fine...Sorry for the...
  12. Sorry about that! I always forget to do that when...

    Sorry about that! I always forget to do that when I declare the constructors and functions.

    This is my new string class:


    class String{
    protected:
    int length;
    char* buf;
    public:
  13. Can't access protected data member from base class in derived class

    Hi everyone, I have a base class "String" and derived the class "ReverseString" from "String". When I try to use member variables from String in the ReverseString class, it is telling me...
  14. Replies
    20
    Views
    3,692

    Ah alright, that makes sense. Thanks for all...

    Ah alright, that makes sense.
    Thanks for all the help everyone! It's much appreciated :D
  15. Replies
    20
    Views
    3,692

    I read up some more on the this pointer and...

    I read up some more on the this pointer and understand what you mean now. I thought my code worked but it actually didn't. I changed it to this:


    IntArray& IntArray::operator=(const IntArray&...
  16. Replies
    20
    Views
    3,692

    iMalc - I read up on passing by const-reference...

    iMalc - I read up on passing by const-reference and from what I understand the reason for doing this is so that the compiler doesn't need to make a copy of the object in order to use it in the...
  17. Replies
    20
    Views
    3,692

    Thanks for all the info! That all makes sense to...

    Thanks for all the info! That all makes sense to me (except for the *this pointer, which for whatever reason always confuses me) however, I apologize I left out the fact that I need to keep each...
  18. Replies
    20
    Views
    3,692

    Ahh I'm sorry I didn't mean to say compare, I am...

    Ahh I'm sorry I didn't mean to say compare, I am trying to set the three objects equal to each other.
  19. Replies
    20
    Views
    3,692

    Overloading assignment operator

    Hi everyone, I'm writing a part of my program that compares three objects of class IntArray:


    IntArray IntArray::operator=(IntArray h){
    if (len != h.len){
    hault();
    }
    else...
  20. In the function: string...

    In the function:



    string ZipCode::zipToBar(int zip) { //Converts zip to bar code
    int zipArr[5];

    string ZERO = "11000",
    ONE = "00011",
    ...
  21. Nevermind, I wan't thinking and used "=" in the...

    Nevermind, I wan't thinking and used "=" in the if statement instead of "==". Thanks for the help though!
  22. Alright, I changed the barToZip funciton to...

    Alright, I changed the barToZip funciton to return type int instead of void, changed the code as you said, and it worked! I keep forgetting about these small things and they always pop up when I do....
  23. Ahh, that was it! Thanks a lot for explaining...

    Ahh, that was it! Thanks a lot for explaining all that, I'll definitely use it in the future :D
    I hate to ask for more advice, but I keep running into more problems...in the following code I am...
  24. I changed the second parameter to 25 as std100093...

    I changed the second parameter to 25 as std100093 said, and that seemed to fix the problem. Also, thanks for the tip laserlight I changed my code accordingly.

    Unfortunatley, now I've run into...
  25. brewbuck - The barCode string is originally 27...

    brewbuck - The barCode string is originally 27 characters long, and I wrote the code in line 2 in order to remove the first and last characters of the string. I wasn't sure if it would work to use...
Results 1 to 25 of 46
Page 1 of 2 1 2