LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > Aquarius_Girl
User Name
Password

Notices


C++
Old

Understanding RAII (Resource Acquisition Is Initialization) - C++

Posted 06-14-2012 at 01:45 AM by Aquarius_Girl
Updated 10-09-2012 at 02:44 AM by Aquarius_Girl

  • Q: What is an exception safe code?
    A: A code may throw an exception but at the same time if it:
    • Doesn't allow any memory (allocated by it) to be leaked.
    • Lets the program to remain in a well-defined state (no dangling pointers
      and all) so that execution can continue as intended.
    • Reports the error to the caller (when encountered).
    then it can be termed as an exception safe code.

    Of course, a code which won't be throwing any exception ever is an exception
...
Senior Member
Views 2014 Comments 0 Aquarius_Girl is offline
Old

this pointer - C++

Posted 03-13-2012 at 11:10 AM by Aquarius_Girl
Updated 03-13-2012 at 10:25 PM by Aquarius_Girl

Quote:
The this pointer is a hidden pointer inside every class's non-static function which points to the class's particular object through which the concerned function is called.
Example:
Code:
class A
{
    private:
        int rollNumber;

    public:
	A (int rollNum)
	{
	    rollNumber = rollNum;
	}

	void setRollNumber (int rollNum)
	{
	    rollNumber = rollNum;
	}
};
...
Senior Member
Posted in Pointers, C++
Views 1791 Comments 0 Aquarius_Girl is offline
Old

What is: Abstract base class, and Pure Virtual function - C++

Posted 11-21-2011 at 04:42 AM by Aquarius_Girl
Updated 01-10-2012 at 08:17 AM by Aquarius_Girl

  • In the cases where the derived classes may share the common functionality
    but with altogether "different" definitions, it makes sense to force the
    developers to create their own definitions for those common functions in
    concerned derived classes.
    This can be achieved by making the class "abstract".
  • A class is called an "abstract" class when it contains at least one "pure
    virtual
    " function.
  • A "pure virtual
...
Senior Member
Views 6217 Comments 0 Aquarius_Girl is offline
Old

Object oriented programming - Objects and Classes [C++]

Posted 11-15-2011 at 03:02 AM by Aquarius_Girl
Updated 06-12-2013 at 12:31 PM by Aquarius_Girl

Object oriented programming is all about representing the parts of
the problem statements as `objects` and having them interact with
each other (by calling function(s) of the object in question).

Every object has a type. The type of an object is often called a
`class` in object oriented programming. The class contains the list
of characteristics of the object and the functions which the object
is capable of performing.
We can have many...
Senior Member
Posted in The basics, C++
Views 1869 Comments 1 Aquarius_Girl is offline

  



All times are GMT -5. The time now is 06:18 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration