Search:

Type: Posts; User: Ashl7

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    44
    Views
    3,707

    I'm so sorry guys, I hate myself right...

    I'm so sorry guys, I hate myself right now...sometimes I miss the smallest inconsequential details and I go look for an error somewhere else, and I do have problem reading and interpreting the errors...
  2. Replies
    44
    Views
    3,707

    can't figure it out for the life of me.

    can't figure it out for the life of me.
  3. Replies
    44
    Views
    3,707

    @phantomotap...

    @phantomotap: you mean I should define it in a way that it gets a null pointer?! (explain pls)
  4. Replies
    44
    Views
    3,707

    I get this error, it is very long!! ...

    I get this error, it is very long!!

    e:\users\ashl7\desktop\sodacan2012\sodacan2012\sodacan.cpp(86): error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'const...
  5. Replies
    44
    Views
    3,707

    Yeah I missed in when I was copy/pasting....but...

    Yeah I missed in when I was copy/pasting....but the brace was already in my code!
  6. Replies
    44
    Views
    3,707

    Ok, I've changed the message, and I'm going to be...

    Ok, I've changed the message, and I'm going to be content with cout message to inform the user about the NULL pointer.
    So, next is overloading >> operator. here's my definition for it:



    ...
  7. Replies
    44
    Views
    3,707

    Thanks guys, I think what the teacher wants us is...

    Thanks guys, I think what the teacher wants us is just to check if the pointer sent to the overloaded function is NULL or not, if it is, show an error(either on screen or using exception handeling)...
  8. Replies
    44
    Views
    3,707

    uuugh! god!! I even declare it with const in my...

    uuugh! god!! I even declare it with const in my header file, but missed it in my definition....thank you!
    any thoughts on the second question?! a way to work with NULL pointer on this class?
  9. Replies
    44
    Views
    3,707

    Answer to No.2 question: apparently I can't do...

    Answer to No.2 question:
    apparently I can't do that! In the driver code by my teacher, we need to print an object of the class without using pointers


    /// junk should have 76 ounces
    junk =...
  10. Replies
    44
    Views
    3,707

    Wow I totally missed that this thread went to the...

    Wow I totally missed that this thread went to the second page! :frown:
    First of all, thanks everyone for the comments.
    @Elysia, I decided to remove some of the codes that my teacher had in his...
  11. Replies
    44
    Views
    3,707

    what does it do?! never read about it! Should I...

    what does it do?! never read about it!
    Should I put it in front of all my functions?! or const functions?! or my overloaded function?
  12. Replies
    44
    Views
    3,707

    Yess, thanks, I remember in the book it said : ...

    Yess, thanks, I remember in the book it said :
    Appreciate it. This problem is fixed, however I still get the error I was getting at first, I have not been able to compile it yet...

    1> ...
  13. Replies
    44
    Views
    3,707

    I didn't say you "have to"....and teaching is...

    I didn't say you "have to"....and teaching is helping :)
    It does not compile, it says : error C2662: 'SodaCan::getContents' : cannot convert 'this' pointer from 'const SodaCan' to 'SodaCan &'
    >...
  14. Replies
    44
    Views
    3,707

    @grumpy: I know the definition that you see...

    @grumpy:
    I know the definition that you see there was a test, I think this one should work, but it does not:



    ostream& operator <<( std::ostream& outs, const SodaCan *can ){


    ...
  15. Replies
    44
    Views
    3,707

    And here's my application file(which I did not...

    And here's my application file(which I did not write, the teacher did), however, the other overloaded functions( ==,>, < etc.) are written by me:



    #include <iostream>
    #include <string>...
  16. Replies
    44
    Views
    3,707

    @Laserlight: I know, passing pointers to...

    @Laserlight:
    I know, passing pointers to functions and overloading is troublesome, but this is the way the teacher wants us to do...
    thanks for reminding me about namespace std, and then using...
  17. Replies
    44
    Views
    3,707

    What do u mean by a "valid pointer"? My...

    What do u mean by a "valid pointer"?
    My application file looks fine...I have:



    SodaCan * ptrCan = new SodaCan( "Coke", 25, 3 );
    SodaCan * nullCan = NULL;

    cout << nullCan << endl;
    cout <<...
  18. Replies
    44
    Views
    3,707

    Homework Problem About Pointers

    Hi, I am trying to figure out what's wrong with my code here?
    I should overload these two operators using pointers, I know how to overload them without pointers, but I guess I'm making a mistake in...
  19. Replies
    29
    Views
    2,001

    and why does this one prints out AB?! it should...

    and why does this one prints out AB?! it should be A itself, since the character in slot 0 is A!!!

    #include <stdio.h>

    int main()
    {
    char *ch;
    char vch[]={'A','B','\0','C','\0'};
    ...
  20. Replies
    29
    Views
    2,001

    Hey all can anyone explain to me why this...

    Hey all
    can anyone explain to me why this program output is AB?
    I mean I think it should be ABC?! shouldn't it?!

    #include <stdio.h>

    int main()
    {
    char *ch;
    char...
  21. Replies
    29
    Views
    2,001

    I had some question not related to programming...

    I had some question not related to programming this time
    Is it necessary to take C++ before taking Java?! is it going to be hard to understand Java if I don't learn C++ in advance?! which one is...
  22. Replies
    29
    Views
    2,001

    Thank you aaaalllll... really helped me out here...

    Thank you aaaalllll... really helped me out here :)
    STD, the examples were just great!
  23. Replies
    29
    Views
    2,001

    lol I read that before, but I'm still...

    lol I read that before, but I'm still confused!!!!!!!!!!
  24. Replies
    29
    Views
    2,001

    questions pouring up... confirm if this is true:...

    questions pouring up...
    confirm if this is true:
    char f[3];
    first character goes to slot 0, second goes to slot 1, third to slot 2, forth is a null character which goes to slot 3.(is it true?)...
  25. Replies
    29
    Views
    2,001

    another thing... is there any difference between...

    another thing...
    is there any difference between an array of characters, and string (and c-style string)?! I mean char i[10] is what we call a string, meanwhile it's an array of characters, right?!...
Results 1 to 25 of 58
Page 1 of 3 1 2 3