Search:

Type: Posts; User: maxsthekat

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,826

    Thanks guys. I knew that if you wanted to change...

    Thanks guys. I knew that if you wanted to change variables you could always do a pass by reference. I didn't realize there was a comparable situation for pointers :)
  2. Replies
    9
    Views
    1,826

    Great. It doesn't work. I fully understand that....

    Great. It doesn't work. I fully understand that. I even understand it's not the proper way of doing this. I still don't see what is the "proper" way of doing it.

    Let me break down the problem for...
  3. Replies
    9
    Views
    1,826

    No, I'm not new to pointers. This is actually a...

    No, I'm not new to pointers. This is actually a much simpler version of what I'm doing... In another program, I have a function which needs to create a 2D array, a single array, and perform some...
  4. Replies
    9
    Views
    1,826

    New keyword and function scope

    Hi guys,

    In the code below, the new keyword creates 5 integers for a pointer. However, whenever I am outside of the createmem() function, I cannot access this memory-- visual studio says that...
  5. Replies
    4
    Views
    1,173

    Works great. Thanks guys :)

    Works great. Thanks guys :)
  6. Replies
    4
    Views
    1,173

    Namespace within a class

    Hi guys,

    I'm having trouble getting a namespace to work from within a class definition. I'm not entirely sure this is possible, but the ultimate goal is to create an object and pass it one of the...
  7. Replies
    7
    Views
    1,634

    Madre de Dios! ... Note to self: "|" !=...

    Madre de Dios!

    ...

    Note to self: "|" != "||"...

    The line "ifstream myfile("STLBox.stl". ios::in || ios::binary);" had an extra "|". So, it was opening in character mode. Doing it correctly,...
  8. Replies
    7
    Views
    1,634

    Read takes a character pointer, not an unsigned...

    Read takes a character pointer, not an unsigned character pointer. So to do it that way, I tried:


    #include <fstream>
    #include <iostream>
    #include <cstdlib>

    using namespace std;
  9. Replies
    7
    Views
    1,634

    Sorry, that's just in there from earlier...

    Sorry, that's just in there from earlier testing... I looked at the character array in the watchlist of Visual Studio, and it only contains default (garbage) characters after the 15 bytes (chars) of...
  10. Replies
    7
    Views
    1,634

    Reading a file in binary

    Hi guys,

    I'm trying to read in a file in binary mode. The file is 684 bytes. If you look at it under a hex editor, you'll notice that there are 15 bytes of all zeros starting around the 85th byte....
  11. Replies
    7
    Views
    1,693

    Aha! Found it! For anyone interested in...

    Aha! Found it!

    For anyone interested in destructor precedence, here's a couple of great links:

    [11] Destructors, C++ FAQ Lite
    Why is destructor called twice? - C++

    The second one is...
  12. Replies
    7
    Views
    1,693

    classnames is just used for setting the name of...

    classnames is just used for setting the name of each individual course within the classLists array (which is made up of singlyLinkedList objects, which contain my linked list). I don't destroy...
  13. Replies
    7
    Views
    1,693

    registrations.txt will have to be renamed to...

    registrations.txt will have to be renamed to registrations.dat in order to work correctly
  14. Replies
    7
    Views
    1,693

    Destroying a linked list

    Hi all!

    I have a destructor implemented below. The problem is, it seems as if it deletes all of the items in the list properly but when the program gets to the final line of code, which is just...
  15. Replies
    11
    Views
    2,520

    Eureaka! Thanks for the help, guys! I read...

    Eureaka!

    Thanks for the help, guys! I read the link, then wrote a copy constructor (then noticed the program already had one-- still, was good practice...) and did as you said for returning by...
  16. Replies
    11
    Views
    2,520

    bithub, Thanks for the reply! :) Here's...

    bithub,

    Thanks for the reply! :)

    Here's what I ran into when I did that: the first object (this) is now altered by the operation (which makes it a +=, instead of a + operator) say you have code...
  17. Replies
    11
    Views
    2,520

    I thought I did that with the snippet, although...

    I thought I did that with the snippet, although the snippet will not compile by itself... Here is the full:

    PtrandRef.h



    #include <iostream>


    using namespace std;
  18. Replies
    11
    Views
    2,520

    laserlight, I would love to use a vector, but...

    laserlight,

    I would love to use a vector, but this little snippet is part of a course I'm taking (universities love to reinvent the wheel for assignments ;)

    What I can't seem to figure out is...
  19. Replies
    11
    Views
    2,520

    Returning an object with a dynamic pointer

    If I have an class with a dynamically allocated array inside of it, how can I return an object from an overloaded addition operator?

    The class is basically:



    class foo
    {
    foo& operator +...
  20. I know this is a C++ board, but I think XNA...

    I know this is a C++ board, but I think XNA (which uses C#) is an easy to pick up beginners intro to game development. It's mostly just a wrapper for the DirectX stuff, so if you get familiar with...
  21. Replies
    2
    Views
    2,131

    Compile error with g++

    Whenever I try to compile a project in g++, I get the following errors (below). I have several other files for this, but I'm refraining from posting all of them to spare monitor-induced headache :)
    ...
  22. Replies
    3
    Views
    4,146

    Hmmm.... Seems to work, which is weird,...

    Hmmm....

    Seems to work, which is weird, because I tried that earlier. Maybe I'm just having a case of the Fridays :P

    Thanks again! If I can ever be of assistance to anyone on this board, please...
  23. Replies
    3
    Views
    4,146

    Assignment operator and iterators

    Hi all!

    Sorry for so many questions. If you feel that I'm abusing this board, please say so, and I'll go elsewhere... I typically consult google, cplusplus.com, codeguru, my books, search the...
  24. Replies
    3
    Views
    4,429

    Thanks for the tips! It's always the simple...

    Thanks for the tips!

    It's always the simple things in life, eh? ;)

    I had tried the include guards as a last-ditch effort. Thanks for the explanation :) It's amazing what changing .cpp to .h in...
  25. Replies
    3
    Views
    4,429

    LNK2005 error (multiple declarations?)

    Hi all!

    I have a class that is distributed between its definition (popClass.h) and its implementation (popClass.cpp). However, when I go to compile this collection, I get a LNK2005 error (all...
Results 1 to 25 of 29
Page 1 of 2 1 2