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
Microsoft Edge comes pre-installed with Windows 11 and it's a great browser, so why not use it? Not everyone is trying to run away from Google, sometimes people just want convenience and less friction.
No. The file manager is a lost cause. After all, its dev receives all the undeserved praise he could evre wish from Neowin, without having actually earned it. This has never lead to improvements.
TechPowerUp GPU-Z 2.70.0 by Razvan Serea
GPU-Z is a lightweight system utility designed to provide vital information about your video card and graphics processor. At launch, it automatically scans your system and reports the card name, GPU, release date and transistors, BIOS version, ROPs, memory type, and memory size.
Main Features:
Supports NVIDIA, AMD, ATI and Intel graphics devices
Displays adapter, GPU and display information
Displays overclock, default clocks and 3D clocks (if available)
Includes a GPU load test to verify PCI-Express lane configuration
Validation of results
GPU-Z can create a backup of your graphics card BIOS
No installation required, optional installer is available
Support for Windows XP / Vista / Windows 7 / Windows 8 / Windows 10 (both 32 and 64 bit versions are supported)
GPU-Z 2.70.0 changelog:
Improved kernel driver security
Added die size for Qualcomm Adreno 741
Added support for NVIDIA RTX 6000D, RTX Pro 500 Blackwell Embedded, Tesla V100-DGXS-32GB, PG500-216
Added support for Intel Arc Pro B70, B65, A60 ES, Alder Lake ES
Added support for Qualcomm Snapdragon X2 Elite, 778G/782G
Added vendor detection for HKC/Sambada, AWES
Download page: GPU-Z 2.70.0 | 11.1 MB (Freeware)
View: GPU-Z Website | Screenshot
Get alerted to all of our Software updates on Twitter at @NeowinSoftware
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