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...
Type: Posts; User: marcoesteves
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...
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 ?
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?
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...
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...
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.
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...
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
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)) {}
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
...
You suggest setprice at book be private. I cannot call at main. SHould I call it at cpp ?
I've changed my function to:
void XBook::setPrice(std::string Label){
if (Label == "Blue"){
m_price = 50.0;
}
}
In main:
Can I do Something like this?
#ifndef XBOOK_H
#define XBOOK_H
#include "xproduct.h"
class XBook : public XProduct
I have this Xbook class:
class XBook : public XProduct
{
protected:
int m_noPages;
std::string m_label;
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.
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.
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...
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...
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...
Iterators come with magic xD
Should I apply to the more complex example all of this Stuff?
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.
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>
...
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"...
no Problem
Elysa's initial instructions.