What is CWinThread class? Explain its advantages.

What is CWinThread class? Explain its advantages. What is function regex and regex_search function?

What is CWinThread class? Explain its advantages

At the beginning of every application has one and only one thread, called as primary thread. CWinApp which is the user derived class encapsulates this thread. In this case pointer to your CWinApp object is also a pointer to the CWinThread object for the primary thread. Once your application gets going, it can create as many new threads as it wants to manage various tasks. CWinApp is derived from CWinThread. It also allows multiple threads within given application. CWinThread supports two types of threads:

Worker threads- it has no message pump i.e. thread that performs background calculations
User interface threads- it has message pump i.e. messages received from system.
It can be declared as:
class CWinThread : public CCmdTarget
The advantages which it has is:
It can assign more than one thread at a time like a multi-threading system.
It terminates the application without any hassles.What is function regex and regex_search function?Regex- Defines a template class to parse regular Expressions, and several template classes and functions to search text for matches to a regular expression object. It is represented as:
#include <regex>

Regex_search Function- it searches for a regular expression match and function returns true only if a search for its regular expression argument succeeds. It is represented as:-
std::cout << "search(string, \"abc\") == " << std::boolalpha
<< regex_search(std::string("a"), rx) << std::endl;
Explain the significance of InitApplication() in VC++.
InitApplication() function is a Boolean method to display an output. This gives output as true if application executes correctly..............
What is a copy constructor? What is the need for it?
Copy constructor is a constructor type which is of the same name as the class and it is used to constructs an object by copying the state from another object.........
Explain pointer to the constant and constant pointer? Explain difference between them.
If you have a value which you don’t want to modify or let anyone else to modify then you make that value as constant. It also means that you don’t want to allow the value to be changed...........
Post your comment