The functions in this section enable you to perform mathematical operations with CDXVec class objects.
operator [] ( int index ) Accesses a dimension of the structure by index as an integer. operator [] ( long index ) Accesses a dimension of the structure by index as a long. operator [] ( USHORT index ) Accesses a dimension of the structure by index as a USHORT. operator [] ( DWORD index ) Accesses a dimension of the structure by index as a DWORD. operator = Assigns components of one vector to another vector. operator != Tests for inequality of two vectors. operator + Adds two vectors, returning a resultant vector. operator - Subtracts two vectors, returning a resultant vector. operator += Increments a vector with another vector. operator -= Decrements a vector with another vector. operator == Tests for equality of two vectors. ZeroVector Sets all components of a vector to zero.
Accesses a dimension of the structure by index.
Syntax
TYPE& operator[]( int index ) const;
Parameters
- index
- Integer value used to access a dimension of the structure.
Return Value
Returns a TYPE& reference.
Accesses a dimension of the structure by index.
Syntax
TYPE& operator[]( long index ) const;
Parameters
- index
- Long value used to access a dimension of the structure.
Return Value
Returns a TYPE& reference.
Accesses a dimension of the structure by index.
Syntax
TYPE& operator[]( USHORT index ) const;
Parameters
- index
- USHORT value used to access a dimension of the structure.
Return Value
Returns a TYPE& reference.
Accesses a dimension of the structure by index.
Syntax
TYPE& operator[]( DWORD index ) const;
Parameters
- index
- DWORD value used to access a dimension of the structure.
Return Value
Returns a TYPE& reference.
Assigns components of one vector to another vector.
Syntax
void operator=( const CDXV_C &srcVector );
Parameters
- srcVector
- Source vector.
Return Value
No return value.
Tests for inequality of two vectors.
Syntax
BOOL operator!=( const CDXV_C &otherVector ) const;
Parameters
- otherVector
- Vector passed in to be tested.
Return Value
Returns TRUE if the vector objects are not equal. Returns FALSE if the vector objects are equal.
Adds two vectors, returning a resultant vector.
Syntax
CDXV_C operator+( const CDXV_C &v );
Parameters
- v
- Vector passed in to be added.
Return Value
Returns a CDXV_C result.
Subtracts two vectors, returning a resultant vector.
Syntax
CDXV_C operator-( const CDXV_C &v );
Parameters
- v
- Vector passed in to be subtracted.
Return Value
Returns a CDXV_C result.
Increments a vector with another vector.
Syntax
void operator+=( const CDXV_C &vOther );
Parameters
- vOther
- Vector passed in to be added.
Return Value
No return value.
Decrements a vector with another vector.
Syntax
void operator-=( const CDXV_C &vOther );
Parameters
- vOther
- Vector passed in to be subtracted.
Return Value
No return value.
Tests for equality of two vectors.
Syntax
BOOL operator==( const CDXV_C &otherVector ) const;
Parameters
- otherVector
- Vector passed in to be tested.
Return Value
Returns TRUE if the vector objects are equal. Returns FALSE if the vector objects are not equal.
Sets all components of a vector to zero.
Syntax
void ZeroVector( void );
Return Value
No return value.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.