C++ class definition with a member of the same class
Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento)
Convert to:
If i compile that, the error is:
May someone help me?
Hello,
i am using the sigaction function to handle the SIGCHLD signal.Is it possible to use a class member function as the handler function (the sa_handler member of the sigaction structure)?
The function's signature is:
void (*sa_handler)(int);so i don't think i can use a static member function... (2 Replies)
im just trying to have some fun and kill some time writing a c++ program that has a person type in a car make and model then gives them a year and a price. or something like that. i always have problems getting it goin but once the ball is rolling im usually pretty good. anyone wanna help me out? ... (1 Reply)
I have the following class and thought that when I call the set command to set a member, I always use value. Would that be fine?
class ModMisfit {
protected:
Real dtau;
Real mdacc;
Real mindist;
bool hw;
Source** src;
public:
void ... (7 Replies)
Hi,
I believe the next code is wrong:
class Egg {
Egg e;
int i;
Egg(int ii=0) : i(ii) {}
};
because you would end up with an endless definition (memory allocation) of Egg objects, thus int i.
Ok, so God Eckel proposes for a singleton:
class Egg {
static Egg e;
int... (5 Replies)
Hi all!
I am trying to register a device in an existing device class, but I am
having trouble getting the pointer to an existing class.
I can create a class in a module, get the pointer to it and then use
it to register the device with:
*cl = class_create(THIS_MODULE, className);... (0 Replies)
I have the two class definition as follows.
class A { public: int a; };
class B : virtual public A{ };
The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
There is base class B, and two derived classes D1 and D2 derived from Base. Base class B, have two data members ( public or protected or private or if any). D1 should inherit both these data members, and D2 should be deriving only one member from Base class. Is this kind of design possible without... (1 Reply)
Hello All,
I am a learner in C++. I was testing my inheritance knowledge with following piece of code.
#include <iostream>
using namespace std;
class base
{
public :
void display()
{
cout << "In base display()" << endl;
}
void display(int k)
{... (2 Replies)
Discussion started by: anand.shah
2 Replies
LEARN ABOUT ULTRIX
xrmstringtoquark
XrmUniqueQuark(3X11) MIT X11R4 XrmUniqueQuark(3X11)Name
XrmUniqueQuark, XrmStringToQuark, XrmQuarkToString, XrmStringToQuarkList, XrmStringToBindingQuarkList - manipulate resource quarks
Syntax
XrmQuark XrmUniqueQuark()
#define XrmStringToName(string) XrmStringToQuark(string) #define XrmStringToClass(string) XrmStringToQuark(string) #define XrmStringToRep-
resentation(string) XrmStringToQuark(string)
XrmQuark XrmStringToQuark(string)
char *string;
#define XrmNameToString(name) XrmQuarkToString(name) #define XrmClassToString(class) XrmQuarkToString(class) #define XrmRepresentation-
ToString(type) XrmQuarkToString(type)
char *XrmQuarkToString(quark)
XrmQuark quark;
#define XrmStringToNameList(str, name) XrmStringToQuarkList((str), (name)) #define XrmStringToClassList(str,class) XrmStringToQuark-
List((str), (class))
void XrmStringToQuarkList(string, quarks_return)
char *string;
XrmQuarkList quarks_return;
XrmStringToBindingQuarkList(string, bindings_return, quarks_return)
char *string;
XrmBindingList bindings_return;
XrmQuarkList quarks_return;
Arguments
bindings_return
Returns the binding list.
quark Specifies the quark for which the equivalent string is desired.
quarks_return
Returns the list of quarks.
string Specifies the string for which a quark is to be allocated.
Description
The function allocates a quark that is guaranteed not to represent any string that is known to the resource manager.
These functions can be used to convert to and from quark representations. The string pointed to by the return value must not be modified
or freed. If no string exists for that quark, returns NULL.
The function converts the specified resource quark representation back to a string.
The function converts the null-terminated string (generally a fully qualified name) to a list of quarks. Note that the string must be in
the valid ResourceName format. The components of the string are separated by a period or asterisk character.
A binding list is a list of type and indicates if components of name or class lists are bound tightly or loosely (that is, if wildcarding
of intermediate components is specified).
typedef enum {XrmBindTightly, XrmBindLoosely} XrmBinding,
*XrmBindingList;
indicates that a period separates the components, and indicates that an asterisk separates the components.
The function converts the specified string to a binding list and a quark list. Component names in the list are separated by a period or an
asterisk character. If the string does not start with period or asterisk, a period is assumed. For example, ``*a.b*c'' becomes:
quarks a b c
bindings loose tightloose
See AlsoXrmGetResource(3X11), XrmInitialize(3X11), XrmMergeDatabases(3X11), XrmPutResource(3X11)
X Window System: The Complete Reference, Second Edition, Robert W. Scheifler and James Gettys
XrmUniqueQuark(3X11)