What happens to the member pointers when an exception occures in constructor, while allocating memory ? how can we over come this ?
Latest Answer: In order to avoid operator ambiguity , :?, ::, . operators are not overloaded. ...
I want C++ code forCreate method inside Principal mentor class called assignAssociates to assign associate mentors from faculty.txt to a course. Create a file named associates.txt store CourseId,FacultyId,Role. Overload assignAssociates function with arguments. Overloading Method1 with three arguments courseId,FacultyId,Role. Overloading Method2 with two arguments courseId,FacultyId. ( Section 6.17 from chapter 6. ) Overload methods compactly and conveniently by using function templates. Create
Latest Answer: Thank you everybody for giving the right answer to the question. However the use of the term "pointer" in the question still leaves a lingering doubt in my mind as to whether the questioner really typoed a reference as a pointer? or did ...
Latest Answer: Constructor is called when an object is created.Copy constructor is called when the copy of an object is made. For e.g. passing parameter to function by value, function returning by value. Copy constructor takes the parameter as const reference to the ...
Latest Answer: depends on the requirement. if you got fixed no of arguments like,sum(int, int)sum(float, float) .. go for Templates.If you have variable arguments and you know the data types, then make use of va_list. ie variable argument list define the function like, ...
Latest Answer: Assuming function is not a part of any class, and member function (obviously) is a part of a class, the difference is their scope.1. Function - is normally refered to a C-style function which has a global level scope. As long as its declaration is visible ...
Latest Answer: To avoid memmory leaks you should use smart pointers. ...
Latest Answer: Copy constructor is 1. a constructor function with the same name as the class 2. used to make deep copy of objects. There are 3 important places where a copy constructor is called. 1. When an object is created from another object of the same type 2. When ...
Latest Answer: include#includeusing namespace std;int main(){ fstream *obj = new fstream(); obj->open ("main.cpp"); ...
View page << Previous 8 9 10 11 [12] 13 14 15 16 17 Next >>

Go Top