Search:

Type: Posts; User: solidusMGS

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    2,934

    Salem, why isn't this working?

    #include<iostream>
    #include<string>
    using namespace std;


    class Human
    {
    public:
    string name;
    int age;
  2. Replies
    25
    Views
    4,306

    That's what I thought, but I read in the text, it...

    That's what I thought, but I read in the text, it said to leave the setters original and to just add the new setters. Maybe I'm just crazy and stupid.

    See you down at Arizona Bay!
  3. Replies
    25
    Views
    4,306

    But I followed the book letter-by-letter!

    But I followed the book letter-by-letter!
  4. Replies
    25
    Views
    4,306

    Where did I go wrong with the first example? ...

    Where did I go wrong with the first example? Member variables are age, etc, member functions are what?
  5. Replies
    25
    Views
    4,306

    Bae please! Does code go something like...

    Bae please!

    Does code go something like this:


    #include<iostream>
    #include<string>
    using namespace std;

    class Dog{
  6. Replies
    25
    Views
    4,306

    But I have been doing cpp for two years! And all...

    But I have been doing cpp for two years! And all studies show all takes to become good at something takes 30 hours of time spent on it.

    Plus, I am confused with the order and why it isn't...
  7. Replies
    25
    Views
    4,306

    But a lot of those books are not in C++ 20!

    But a lot of those books are not in C++ 20!
  8. Replies
    25
    Views
    4,306

    Ok, can you suggest a book?

    Ok, can you suggest a book?
  9. Replies
    25
    Views
    4,306

    It said to do it.

    It said to do it.
  10. Replies
    25
    Views
    4,306

    #include#include using...

    #include<string>#include<iostream>
    using namespace std;


    class Dog
    {

    int age, weight;
    string color;
  11. Replies
    25
    Views
    4,306

    I originally could compile it successfully, only...

    I originally could compile it successfully, only when I added more did things go wrong...
  12. Replies
    25
    Views
    4,306

    Now you are just being smug and not helpful. I...

    Now you are just being smug and not helpful. I could use a new book, but still. It won't help if I didn't get something as simple as encapsulation and how to do it right.
  13. Replies
    25
    Views
    4,306

    But the book showed the code in that form. The...

    But the book showed the code in that form. The member variables go into the main block or the class block?
  14. Replies
    25
    Views
    4,306

    main.cpp: In member function ‘void...

    main.cpp: In member function ‘void Dog::setAge(int)’:
    main.cpp:12:24: error: ‘age’ was not declared in this scope
    12 | void setAge(int yrs) {age = yrs;}
    | ^~~...
  15. Replies
    25
    Views
    4,306

    Where am I going wrong?

    #include<string>#include<iostream>
    using namespace std;


    class Dog
    {

    void setValues( int, int, string);

    public:
  16. Replies
    4
    Views
    1,502

    #include#include #include...

    #include<fstream>#include <string>
    #include <iostream>
    using namespace std;


    int main()
    {
    const int RANGE = 12;
    string tab[ RANGE ];
    int i = 0, j = 0;
  17. Replies
    4
    Views
    1,502

    Cgywin won't open fstream files...

    I code the way it is suppose to, but cgywin closes the window after compiling, and I don't understand why? Does anyone know how to troubleshoot cgywin for fstream?

    It's mostly a hit or a miss...
  18. Replies
    4
    Views
    1,458

    Not saying I don't believe you! Just kinda...

    Not saying I don't believe you!

    Just kinda curious how you would fix it....
  19. Replies
    4
    Views
    1,458

    But I copied the code word-for-word!

    But I copied the code word-for-word!
  20. Replies
    4
    Views
    1,458

    Spot the error?

    #include<string>#include<iostream>
    using namespace std;


    void computeFeatures(string);


    int main()
    {
    string text = "Cpp is fun";
  21. Replies
    2
    Views
    1,737

    Where am I going wrong here?

    Trying to use an inline function to do a factorial, yet won't compile:


    #include<iostream>using namespace std;


    inline int factorial(int n);
    int computeFactorials(int, int);
  22. Thank you, daddy. I love you.

    Thank you, daddy. I love you.
  23. Sorry, I meant to say with the = sign nothing...

    Sorry, I meant to say with the = sign nothing compiles and get an error.
  24. I tried that and it did not compile. When I do...

    I tried that and it did not compile. When I do compile I get rubbish memory instead of the value in the code.
  25. Not sure where the mistake is coming from?

    The value is correct...almost. I don't get the 25 value the boook gets:




    #include<iostream>
    using namespace std;
    int main()
    {
    int *num_ptr{ nullptr };
Results 1 to 25 of 100
Page 1 of 4 1 2 3 4