Sponsored Content
Full Discussion: sort a vector
Top Forums Programming sort a vector Post 302501795 by homeboy on Friday 4th of March 2011 08:32:07 PM
Old 03-04-2011
Quote:
Originally Posted by Corona688
You should be using references though! Otherwise it creates a copy ever time which is very slow. You just have to make it a const reference.
yeah,got itSmilie
 

10 More Discussions You Might Find Interesting

1. Programming

Saving a vector to a file

Another C++ question, please do notify me if this forum is C-only! :) I'm having a vector... vector<Person> x; ... with a class I've defined (Person). I have several elements in this vector and I would like to save it to a file (binary (?)). And later on open up this file to retrieve... (1 Reply)
Discussion started by: J.P
1 Replies

2. Programming

Linker error when using vector's

using SUN C++ I have a problem when I do a push_back on a vector. The linker gives me a undefined symbol error on __cxa_end_catch. Any ideas, is there a library to include? Thanks Chris (1 Reply)
Discussion started by: CDurkin
1 Replies

3. Programming

Vector Traversing

Hi i have the following structure struct S { char Mod_num; char val; char chr_nm_cd; } I am reading a 2GB file and inserting into the structure and writing into a vector. I feel like only vector will be a right option. I tried with multimap but it is memory intensive and hence i... (1 Reply)
Discussion started by: dhanamurthy
1 Replies

4. Programming

multidimensional array using c++ vector

Hi! I need to make dynamic multidimensional arrays using the vector class. I found in this page How to dynamically create a two dimensional array? - Microsoft: Visual C++ FAQ - Tek-Tips the way to do it in 2D, and now i'm trying to expand it to 3D but i don't understand how is the operator working,... (0 Replies)
Discussion started by: carl.alv
0 Replies

5. Programming

c++ mutidimentional arrays using vector

Hi! I need to make dynamic multidimensional arrays using the vector class. I found in this page How to dynamically create a two dimensional array? - Microsoft: Visual C++ FAQ - Tek-Tips the way to do it in 2D, and now i'm trying to expand it to 3D but i don't understand how is the operator working,... (1 Reply)
Discussion started by: carl.alv
1 Replies

6. Programming

C++ Map using a Vector as a Value Type?

I modified some code I found on Wikipedia concerning maps to see if it would work before applying it to a project I'm working on that has a similar idea. What I would want is for a user to be able to enter sentences and then be able to distinguish how many times a the person entered a word in a... (4 Replies)
Discussion started by: kcgb20
4 Replies

7. Programming

Array and Vector

Hi all, from my understanding I understand that I can use array in this manner. struct test { int a; int b; int c; }; test testing; //creating an array with the structer type testing.a=1; testing.b=2; testing.c=3; If I'm not wrong we can use array in this manner,... (12 Replies)
Discussion started by: vinzping
12 Replies

8. Programming

vector c++

hello guys. i'm new to c++. i've problem using two dimensional vector. i've a project of making conway's game of life. this is the code that i have made so far. my problem is how can i give a two dimensional vector through main. glider.vec1 = vec; is not correct way to give a two... (2 Replies)
Discussion started by: nishrestha
2 Replies

9. Shell Programming and Scripting

Vector normalisation

In AWK For 3 individual vectors of the form: -2.772 -9.341 -2.857 -5.140 -6.597 -1.823 -2.730 -5.615 1.159 I would like to write a script that parses line by line to (i) normalise, (ii) divide by the norm for *each* vector. I.e. sqrt(-2.772^2 + -9.341^2 + -2.857^2)=10.154 ... (4 Replies)
Discussion started by: chrisjorg
4 Replies

10. Programming

Number to bit vector

Is there a function to convert number (unsigned int for this example) to binary? I could not find a simple one thru google. While I was learning bloom filter with the example, I was wondering if anybody can help me to 1) display the real bits vector for the bloomfilter; 2) if dataset is very... (11 Replies)
Discussion started by: yifangt
11 Replies
QDomEntityReference(3qt)												  QDomEntityReference(3qt)

NAME
QDomEntityReference - Represents an XML entity reference SYNOPSIS
#include <qdom.h> Inherits QDomNode. Public Members QDomEntityReference () QDomEntityReference ( const QDomEntityReference & x ) QDomEntityReference & operator= ( const QDomEntityReference & x ) ~QDomEntityReference () virtual QDomNode::NodeType nodeType () const virtual bool isEntityReference () const DESCRIPTION
The QDomEntityReference class represents an XML entity reference. A QDomEntityReference object may be inserted into the DOM tree when an entity reference is in the source document, or when the user wishes to insert an entity reference. Note that character references and references to predefined entities are expanded by the XML processor so that characters are represented by their Unicode equivalent rather than by an entity reference. Moreover, the XML processor may completely expand references to entities while building the DOM tree, instead of providing QDomEntityReference objects. If it does provide such objects, then for a given entity reference node, it may be that there is no entity node representing the referenced entity; but if such an entity exists, then the child list of the entity reference node is the same as that of the entity node. As with the entity node, all descendents of the entity reference are read-only. For further information about the Document Object Model see http://www.w3.org/TR/REC-DOM-Level-1/ and http://www.w3.org/TR/DOM- Level-2-Core/. For a more general introduction of the DOM implementation see the QDomDocument documentation. See also XML. MEMBER FUNCTION DOCUMENTATION
QDomEntityReference::QDomEntityReference () Constructs an empty entity reference. Use QDomDocument::createEntityReference() to create a entity reference with content. QDomEntityReference::QDomEntityReference ( const QDomEntityReference & x ) Constructs a copy of x. The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use cloneNode(). QDomEntityReference::~QDomEntityReference () Destroys the object and frees its resources. bool QDomEntityReference::isEntityReference () const [virtual] Returns TRUE. Reimplemented from QDomNode. QDomNode::NodeType QDomEntityReference::nodeType () const [virtual] Returns EntityReference. Reimplemented from QDomNode. QDomEntityReference &; QDomEntityReference::operator= ( const QDomEntityReference & x ) Assigns x to this entity reference. The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use cloneNode(). SEE ALSO
http://doc.trolltech.com/qdomentityreference.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qdomentityreference.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QDomEntityReference(3qt)
All times are GMT -4. The time now is 07:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy