Thanks everyone, this has definately helped me a lot.
Type: Posts; User: theJ89
Thanks everyone, this has definately helped me a lot.
Ok, I have set it up to use the cstdarg header. Now I am having troubles converting it from a char to an "ItemClass *" (custom class). Here is the code I am using:
ItemClass**...
If you have ever scripted with Javascript you are aware of the arguments array that a function possesses. Basically, you could do something like this in Javascript:
//Define
function myFunc()...
Thank you. I disabled the pointer thing because it was giving me additional compiler errors related to the original error, should have mentioned that.
Hello. Currently I am working on a class that holds a vector of pointers to objects.
Compiler errors in Visual Studio C++:
* cppsample\headers\Item.h(31): error C2065: 'ItemClass' :...
Thank you.
I am working on something to basically hold references to several objects. So the plan was something like this:
obj **cPList=new *obj[30];
However I get compiler errors when I try this....
You might want to try the using namespace std; statement so you don't have to keep typing std::*
Hah, I forgot to use the namespace. Thank you.
Also I might mention that the file should only be included once. Is there any replacement for #pragma once?
Sorry to be a bother or anything with my assult of questions, but currently I am working on a class to handle files. The problem I currently have (and I'm sure it is something simple I am missing...
So space for allocation is retained in the process after something is deleted?
How do I give it back to the OS without ending the process? Other programs may need it.
I watched it in task manager. The memory usage for the program increased by 2KB when allocating 50 of them dynamically, and did not decrease when I deleted them.
Uh, no, but the memory usage isn't the issue here. Being able to successfully delete dynamically allocated memory is.
Hello, I've been working on a custom linked list for objects. The problem is I am deleting objects in the linked list, however it is having no effect on the memory usage.
I do not recieve any...
Ah, I understand now. Thanks for your patience. I'm used to scripting languages like Javascript so the transition over to C++ is rough for me. But I understand now.
I was using this in an example...
So, you're saying it's impossible to delete variables that aren't dynamically allocated?
Hello, again. I'm having problems with the Visual Studio compiler. I've defined an "A" class and then created an "A" object "a" inside of the main function. But whenever I attempt to "delete a;" the...
The problem is we are designing a game and we need a fast method of removing and adding items. And I have heard that vectors are very slow. Up until now I have been making due by changing the amount...
dX and dY are private, don't they have to be protected for other classes to reference them via the friend statement?
Point Line::readPts(Point p1, Point p2)
Also notice that function doesn't...
I have made a program that introduces a class, Inventory, that holds a given number of items introduced by the constructor. Observe:
class Inventory
{
public:
Inventory()
{
...
Thank you, I have solved my problem now.
Thank you for the tips, I've adapted the main .cpp for that, but there are still linker errors.
If anyone else can help me solve this I'd be grateful.
Hello! I'm new to the forums and C++ as well. I've been following through a few books but I haven't found how to do this correctly yet.
I'm programming a console application using Visual C++.
...