C++ (Non Visual C++ Issues) RSS

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Copy of object

    So i haven't my MSDN cd at workand i don't know/rememeber how i can make a copy of an object with this:i have a pointer OBJECT * LPsrc; // it's a pointer to a valide objecti have also a containerOBJECT dst; // it's an object I WANT COPY THE OBJECT POINTED by "LPsrc" into "dst" !!...

    1 answers | 797 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • Copy Object memory

    Hi!I'm new to this and I have the following problem:I want to copy the contence from one object to an other by "pointing to the memory". The usual way to copy an CObject is member by member and as the structure is very large it would be to slow (minutes). The classes I use are like this:class C...

    3 answers | 798 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • copy one file to another

    my task is really simple but I have some problems solving it. I gues it is a matter of seconds for someone to tell me how to Write a program copy_file that copies one file to another. The file names are specified on the command line. For examplecopy_file data1.txt data2.txt10x in advance!Victor Kova...

    24 answers | 334 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • Copy of a stream?

    I have a class (lets call it A) which has a protected ostream member. I want to be able to pass an ostream through the constructor and store the copy in the protected member (the copy ensures that if the original ostream passed to the constructor goes out of scope, the classes ostream is still valid...

    1 answers | 1325 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • copy constructors, destructors etc

    i have CSimpleArray<ImageAndPath> ImageAndPaths = CSimpleArray<ImageAndPath>();ImageAndPath is defined below:class ImageAndPath{public: ImageAndPath(const ImageAndPath& iap) { *this = iap; bCopy = true; } ImageAndPath(const CString& str) { USES_CONVERSION; path = str; pImage = new B...

    2 answers | 816 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • copy constructors in derived classes

    I created this very small scenario because I can't understand why the wrong constructors appear to get called.class A{ char* m_Ptr; static char Count;public: A() { m_Ptr = new char[100]; memset(m_Ptr, Count, 100); Count++; } ~A() {delete[] m_Ptr;} A(const A& RHS) { m_Ptr...

    4 answers | 1795 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • copy constrution & default copying

    could sum1 explain to me when does copy construction occur in c++. & what is default copying & wat problems can it introduce....

    5 answers | 125 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • Correct way to return a char*

    Say I have a simple function that returns the first 5 characters of a string:char* first(const char* lpStr){ int nLen = strlen(lpStr); static char* lpTemp = (char*) malloc(6); for(int i = 0; i < 5; i++) { lpTemp[i] = lpStr[i]; } lpTemp[i] = '\0'; return lpTemp;}Is this the correct way...

    18 answers | 491 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • copy constructor problem

    Calling code (main.cpp): //make a duplicate of kb called kb2 Keyboard kb2(kb);Copy constructor (Layout.cpp -- need to change the file name eventually):Keyboard::Keyboard(const Keyboard &rhs){ name = rhs.getName(); //string score = rhs.getScore(); //int //etc..}(line: name = rhs.getName();...

    12 answers | 1029 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • Copy Constructor that transfers ownership

    How do I write a copy constructor that transfers ownership?...

    7 answers | 59 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • copy constructor question

    Hello,I have a class CNodeTest derived from CBaseNode. I have the following code whihc does not compile:CNodeTest CNodeTest ::Complement(){ CNodeTest comp; // TODO: change some math here return comp;}CBaseNode* CNodeTest ::ComplementNew(){ return new CNodeTest(Complement());}I know a default copy...

    2 answers | 510 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • Copy Constructor question

    very newbie question - :blush: what is copy constructor and why use it?Avi....

    7 answers | 91 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • copy constructor question

    I get an error when compiling the follow code:class SomeType{public: SomeType() { }; SomeType(SomeType& x) {};};std::vector<SomeType> array;SomeType sometype1;array.push_back(sometype1);I get:error C2558: class 'SomeType' : no copy constructor availableBut I defined the copy construc...

    2 answers | 468 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • copy constructor/operator/friend classes or methods

    Hi.. im having some problems here a C++ assignment. i hope someone can help methese are included in the header file1- BasicArray(const BasicArray&); //copy constructorhow do i define this? and can i do it without:BasicArray& operator = (const BasicArray& rhs); //assignmentwhat is the relationship be...

    14 answers | 813 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

  • copy constructor, push_back woes

    I'm really green at this, but I'm trying to get my head wrapped around copy constructors and after about 2 hours I'm no further ahead. All I want to do is push_back a new object into a vector of that object.I'll post the code first, then the error i'm getting down at the bo...

    5 answers | 2292 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

QUESTION ON "C++ (Non Visual C++ Issues)"
VISUAL C++ TECH