Search:

Type: Posts; User: theJ89

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    1,413

    Thanks everyone, this has definately helped me a...

    Thanks everyone, this has definately helped me a lot.
  2. Replies
    8
    Views
    1,413

    Ok, I have set it up to use the cstdarg header....

    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**...
  3. Replies
    8
    Views
    1,413

    Repeating argument in functions.

    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()...
  4. Replies
    2
    Views
    1,302

    Thank you. I disabled the pointer thing because...

    Thank you. I disabled the pointer thing because it was giving me additional compiler errors related to the original error, should have mentioned that.
  5. Replies
    2
    Views
    1,302

    Vectors using object pointers.

    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' :...
  6. Replies
    3
    Views
    1,196

    Thank you.

    Thank you.
  7. Replies
    3
    Views
    1,196

    Dynamically allocate a pointer?

    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....
  8. Thread: BS Errors

    by theJ89
    Replies
    11
    Views
    2,211

    You might want to try the using namespace std;...

    You might want to try the using namespace std; statement so you don't have to keep typing std::*
  9. Replies
    6
    Views
    1,534

    Hah, I forgot to use the namespace. Thank you. ...

    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?
  10. Replies
    6
    Views
    1,534

    Including string with header?

    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...
  11. So space for allocation is retained in the...

    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.
  12. I watched it in task manager. The memory usage...

    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.
  13. Uh, no, but the memory usage isn't the issue...

    Uh, no, but the memory usage isn't the issue here. Being able to successfully delete dynamically allocated memory is.
  14. Deleting objects show no drop in memory usage.

    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...
  15. Replies
    7
    Views
    5,383

    Ah, I understand now. Thanks for your patience....

    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...
  16. Replies
    7
    Views
    5,383

    So, you're saying it's impossible to delete...

    So, you're saying it's impossible to delete variables that aren't dynamically allocated?
  17. Replies
    7
    Views
    5,383

    Cannot delete objects

    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...
  18. Replies
    3
    Views
    2,185

    The problem is we are designing a game and we...

    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...
  19. Thread: Class problem

    by theJ89
    Replies
    3
    Views
    1,022

    dX and dY are private, don't they have to be...

    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...
  20. Replies
    3
    Views
    2,185

    Deleting Dynamically Allocated Array Members

    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()
    {
    ...
  21. Replies
    4
    Views
    1,822

    Thank you, I have solved my problem now.

    Thank you, I have solved my problem now.
  22. Replies
    4
    Views
    1,822

    Thank you for the tips, I've adapted the main...

    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.
  23. Replies
    4
    Views
    1,822

    Having two classes reference each other.

    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++.
    ...
Results 1 to 23 of 23