OValue Method

Applies To

OValue

Description

OValue
constructor

Usage

OValue
(void)

OValue(const OValue &otherval)

OValue(int val)

OValue(long val)

OValue(double val)

OValue(const char *val)

Arguments

otherval
Another OValue object whose value you are copying.
val
A value that you are placing into the OValue.

Remarks

These methods construct OValue objects.

The default constructor method constructs an OValue with a value of NULL.

The copy constructor copies the value of the other OValue object. The copy constructor can fail, in which case the constructed OValue has a value of NULL.

The rest of the constructors allow the OValue to be initialized with values of various types. The initialization with a string value can fail (because of memory allocation failure), in which case the OValue has a value of NULL.

Example

Construct several OValues:

OValue str45("45");

OValue int45(45);

OValue long45(45L);

OValue double45(45.0);

OValue val45(str45);

OValue valnull;

// str45, int45, long45, double45 and val45 are all

// equal according to operator==