I am new to C++, and I am making a simple RPG game. I have an 'Item' class, which has properties and methods that all items will have. I need to be able to:
a) Inherit from this class to make a class with the item properties and methods, along with new ones
b) Make a new instance of this class in my main class. For example in vb.net:
Class MainClass
dim sword as new ItemClass
End Class
I'd basically agree. The only point I would add is to be careful not to treat science as a religion, complete with priests, dogma, and blasphemy.
Humans are highly susceptible to religious-oriented ways of thinking since it aids in forming communities of like-minded people. The problem is that when this happens, nobody wants to be ostracized from the group by saying that a deeply-held idea is wrong. Science and "peer review" are not immune to this behavior, unfortunately.
In the end, finding truth is our own responsibility and we can't depend on others to hand it to us. Skepticism is key, along with curiosity and the willingness to critically evaluate and consider ideas both new and old.
I would use BitWarden or 1Password long before I used Chromes password manager. A browser is the piece of software that actually interfaces with the internet. If it has a vulnerability and houses your passwords??
KeePassXC does support passkeys. In Firefox I know you can turn off the thing where Firefox offers to save passwords. On Android KeepassDX (the mobile client) supports autofill
Recent Achievements
JuvenileDelinquent earned a badge Dedicated
DrWankel earned a badge First Post
DrWankel earned a badge Reacting Well
Supreme Spray LV earned a badge Week One Done
Genuinetonerink- Dubai earned a badge Week One Done
Question
McDonger
I am new to C++, and I am making a simple RPG game. I have an 'Item' class, which has properties and methods that all items will have. I need to be able to:
a) Inherit from this class to make a class with the item properties and methods, along with new ones
b) Make a new instance of this class in my main class. For example in vb.net:
I have tried the following in C++:
However this gives me the error:
error C2061: syntax error : identifier 'ItemClass'
so it isn't recognising the other class? Thanks for any help :)
Link to comment
https://www.neowin.net/forum/topic/594046-c-how-to-create-instance-of-another-class/Share on other sites
6 answers to this question
Recommended Posts