Search:

Type: Posts; User: marcoesteves

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    168
    Views
    29,525

    I don't know how tough can be and which is the...

    I don't know how tough can be and which is the best way.
    Probably doing CLI it is a waste of time. GUI will use the same "tough" principles.
    However, which is the best GUI to start with C++. QT is...
  2. Replies
    168
    Views
    29,525

    You were right. It works :) Next step? Create...

    You were right. It works :)

    Next step? Create a interface which enables creating objects by File I/O?
    Create a CLI to user interface?
    Jump to GUI? Which GUI, QT, GTK ?
  3. Replies
    168
    Views
    29,525

    It makes all sense. However, If the Book...

    It makes all sense.
    However, If the Book Constructor doesn't have the price, how I can set the ComicBook Price as a Label function?
  4. Replies
    168
    Views
    29,525

    I'd like ComicBook's price set by label....

    I'd like ComicBook's price set by label. ComicBook is a book with 2 more attributes. The Universe and the Creator.
    At Book Class I'm able to calc price inherite the Product class.
    ComicBook is a...
  5. Replies
    168
    Views
    29,525

    I think that I did it right now. However I have...

    I think that I did it right now.
    However I have another doubt. I have XComicBook class which is a Book. If I change the Book constructor how can I set the XComicBook price?
    Should I change...
  6. Replies
    168
    Views
    29,525

    My only doubt is the initilialization. I see in...

    My only doubt is the initilialization.
    I see in your examples and at web People using virtual class = 0.
    And I didn't do it.




    The compiler ! It won't compile.
  7. Replies
    168
    Views
    29,525

    At this case I need an abstract class. I...

    At this case I need an abstract class.
    I updated the code. I'm not sure if I created in correct way the virtual class.

    I don't get how can I ride off "Price" from constructor. Do I need create...
  8. Replies
    168
    Views
    29,525

    Thanks! I updated my code, however I've got an...

    Thanks!

    I updated my code, however I've got an error in other classes:

    "undefined reference to `XProduct::~XProduct()'"

    Do I need to declare the virtual class in all?


    #ifndef XBOOK_H
  9. Replies
    168
    Views
    29,525

    you wrote: Base(int foo, int bar): m_foo(foo),...

    you wrote:

    Base(int foo, int bar): m_foo(foo), m_bar(bar) {}

    Why not?


    Base(int foo, int bar): m_foo(std::move(foo)), m_bar(std::move(bar)) {}
  10. Replies
    168
    Views
    29,525

    Thank you for your time. I've started digging...

    Thank you for your time.
    I've started digging into example, however I've figured it out that it didn't compile.


    ../derivedClasses/main.cpp:10:21: error: pure-specifier on function-definition
    ...
  11. Replies
    168
    Views
    29,525

    You suggest setprice at book be private. I cannot...

    You suggest setprice at book be private. I cannot call at main. SHould I call it at cpp ?
  12. Replies
    168
    Views
    29,525

    I've changed my function to: void...

    I've changed my function to:


    void XBook::setPrice(std::string Label){
    if (Label == "Blue"){
    m_price = 50.0;
    }
    }

    In main:
  13. Replies
    168
    Views
    29,525

    Can I do Something like this? #ifndef...

    Can I do Something like this?


    #ifndef XBOOK_H
    #define XBOOK_H

    #include "xproduct.h"


    class XBook : public XProduct
  14. Replies
    168
    Views
    29,525

    I have this Xbook class: class XBook :...

    I have this Xbook class:


    class XBook : public XProduct
    {

    protected:
    int m_noPages;
    std::string m_label;
  15. Replies
    168
    Views
    29,525

    Niether I. I'm trying to understand how can I...

    Niether I.

    I'm trying to understand how can I use this information. I've search in books and I didn't find how can I use at my example.
  16. Replies
    168
    Views
    29,525

    Something like: void...

    Something like:


    void XProduct::XProduct(float x): XBook(etc, CalcPrice(x))

    ?

    I think that I understood, but I don't get it out to implement it.
  17. Replies
    168
    Views
    29,525

    I have some dificulties. I want Xbook inherite...

    I have some dificulties.

    I want Xbook inherite from XProduct all the useful attributes.
    However, I think that I don't need to create a overload constructor to Xbook with Price, because Price in...
  18. Replies
    168
    Views
    29,525

    Book's price it is a function of labelcolor. So,...

    Book's price it is a function of labelcolor.
    So, it seems to me correct price be a private attribute without setfunction (to the user), however with a mutator function to the program.

    When a user...
  19. Replies
    168
    Views
    29,525

    I've updated a git : ...

    I've updated a git : https://github.com/CreativeSoftware/LearnCppByExample

    How can I can I make a book price change according to the label color?

    I was thiking about user interface. Probably...
  20. Replies
    168
    Views
    29,525

    Iterators come with magic xD Should I apply to...

    Iterators come with magic xD

    Should I apply to the more complex example all of this Stuff?
  21. Replies
    168
    Views
    29,525

    Here it is another update. I hope that is what...

    Here it is another update. I hope that is what you ask for Elysia:


    #include <iostream>
    #include <vector>

    std::vector<int> v;
    // Now create code that accesses the n'th element of v.
  22. Replies
    168
    Views
    29,525

    I don't know if I'm doing something wrong when I...

    I don't know if I'm doing something wrong when I create the project.

    I think the 1st part is done, the second one not, something is missing.


    #include <iostream>
    #include <vector>
    ...
  23. Replies
    168
    Views
    29,525

    Ok, it is fine, I think that I'm too attached at...

    Ok, it is fine, I think that I'm too attached at i 's and j's .

    Now, I'm thinking: "Ok print them all it's fine, but I want to acess a particular index? My class types doesn't have "at"...
  24. Replies
    168
    Views
    29,525

    no Problem

    no Problem
  25. Replies
    168
    Views
    29,525

    Elysa's initial instructions.

    Elysa's initial instructions.
Results 1 to 25 of 122
Page 1 of 5 1 2 3 4