Search:

Type: Posts; User: cuo741

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    998

    Returning by reference

    Hi, i have a question, so suppose you have a function and it had a return value that was a reference like int& foo(), why would you return an int instead of a int& like the return value says we're...
  2. Replies
    11
    Views
    4,337

    I still kinda dont get it, i sort of get it but,...

    I still kinda dont get it, i sort of get it but, i'm still confused on the return value and stuff. Can you explain why is that the return value is String& and we return an object(*this) and in the...
  3. Replies
    11
    Views
    4,337

    But, we don't return a alias to the object, we...

    But, we don't return a alias to the object, we just return the object itself dont we though? I'm sorry for the trouble, thank you for the help
  4. Replies
    11
    Views
    4,337

    What i meant was like, if i return an object will...

    What i meant was like, if i return an object will the return value come out as a reference to that object but you're arent actually returning the actual object?

    And also, in this other snippet of...
  5. Replies
    11
    Views
    4,337

    I haven't learned how to throw exceptions yet,...

    I haven't learned how to throw exceptions yet, the book covers that in later chapters so this would be the appropriate code for my level of programming but, later on i'll make sure to fix that.

    I...
  6. Replies
    11
    Views
    4,337

    Overloading Assignment Operator, this pointer

    Hi, i'm confused about these lines of code:
    (this is in the POV of me talking to the creator of a book thats why im saying you guys(as in the writers of the book))


    String& operator=(const...
  7. Replies
    1
    Views
    911

    Need help with black jack

    Hello, so I've been working on a little project of mine, i'm trying to imitate a black jack game without the fancy rules though, just the basics. Here's the code:



    #include <iostream>
    #include...
  8. Replies
    7
    Views
    2,906

    C++ is my first language btw, i'm on classes...

    C++ is my first language btw, i'm on classes right now.
  9. Replies
    1
    Views
    987

    C++ on college app.

    How much will knowing how to competently code in C++ look on my college app. I heard it looks good but, how good does it look? By that i mean like will it give a little leeway on grades or SAT...
  10. Replies
    7
    Views
    2,906

    Get better at programming?

    I was wondering is there a way to get better at programming?? like i know i've heard the usual response, "Practice makes perfect so just keep programming". Like sometimes when im programming i'm...
  11. Thread: Vector checking

    by cuo741
    Replies
    14
    Views
    1,529

    I don't really know what you guys are saying...

    I don't really know what you guys are saying because I'm only on classes right now. Any tips on getting better at Object Oriented Programming?
  12. Thread: Vector checking

    by cuo741
    Replies
    14
    Views
    1,529

    Okay thanks

    Okay thanks
  13. Thread: Vector checking

    by cuo741
    Replies
    14
    Views
    1,529

    Like I'm trying to write a method of class Human...

    Like I'm trying to write a method of class Human thats named getItem. It is suppose to check if the 0th element of the vector is empty or not written yet and store the string(Name of item) in there...
  14. Thread: Vector checking

    by cuo741
    Replies
    14
    Views
    1,529

    Is there any way I'm able to do this then?

    Is there any way I'm able to do this then?
  15. Thread: Vector checking

    by cuo741
    Replies
    14
    Views
    1,529

    Vector checking

    I was wondering if there was a way to check if theres already stored in a vector element.
    For example:


    vector<string> Inventory;


    I searched up vector methods and I saw the empty() method...
  16. Replies
    21
    Views
    2,222

    I was wondering if you guys could think up a...

    I was wondering if you guys could think up a exercise using classes and ill try to make a program for it?? it doesnt have to be fancy and stuff
  17. Replies
    11
    Views
    1,454

    Really??I searched it up on Amazon and the...

    Really??I searched it up on Amazon and the reviews are pretty good but, i dont know
  18. Replies
    21
    Views
    2,222

    But dont you need to have a pointer in the...

    But dont you need to have a pointer in the parameters of DrinkWater so it can point at an object and modify the member variables of that instance?
  19. Replies
    21
    Views
    2,222

    i've finished my waterbottle program: ...

    i've finished my waterbottle program:


    #include <iostream>
    using namespace std;

    class Waterbottle
    {
    public:
    string Brand;
  20. Replies
    21
    Views
    2,222

    when i do this: Waterbottle *ptrBottle; ...

    when i do this:


    Waterbottle *ptrBottle;
    ptrBottle = new Waterbottle;


    am i making a instance named ptrBottle of class Waterbottle??
    and if so, when i call a function would i have write...
  21. Replies
    21
    Views
    2,222

    Yay! it worked ;D thanks a lot for your help, i...

    Yay! it worked ;D thanks a lot for your help, i kinda get classes a little bit better now.
  22. Replies
    21
    Views
    2,222

    #include using namespace std; ...

    #include <iostream>
    using namespace std;

    class Waterbottle
    {
    public:
    string Brand;
    float height;
    int WaterLevelPercent;
  23. Replies
    21
    Views
    2,222

    #include using namespace std; ...

    #include <iostream>
    using namespace std;

    class Waterbottle
    {
    public:
    string Brand;
    float height;
    int WaterLevelPercent;
  24. Replies
    11
    Views
    1,454

    well, if you remember my objects in functions...

    well, if you remember my objects in functions thread, its not that i dont know it, i would say im familiar with it but, i cant think of any programs to implement the skills i have learned.
  25. Replies
    11
    Views
    1,454

    I've done some of C and i went up to 2D arrays...

    I've done some of C and i went up to 2D arrays before i went on to learn C++
Results 1 to 25 of 71
Page 1 of 3 1 2 3