Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
iterator
- Page 1
Re: Iterator Class Help
Programming
Software Development
15 Years Ago
by lancevo3
…amp;, const List<T>&); friend class
Iterator
; private: LNode<T>* head; LNode&… public:
Iterator
();
Iterator
(LNode<T>*);
Iterator
<T>& operator++();
Iterator
<T> operator++(int);
Iterator
<T&…
Re: Iterator Class Help
Programming
Software Development
15 Years Ago
by mrnutty
… #include <iostream> template <class T> class
Iterator
; template <class T> class List; template <class…;* nodePtr; public:
Iterator
();
Iterator
(LNode<T>*);
Iterator
<T>& operator++();
Iterator
<T> operator++(int);
Iterator
<T>…
Iterator Class Help
Programming
Software Development
15 Years Ago
by lancevo3
…;, const List<T>&); friend class
Iterator
; private: LNode<T>* head; LNode….h:75: error: ISO C++ forbids declaration of â
Iterator
â with no type List.h:75: error: expected â;â…expected â;â before â<â token List.h:79: error: â
Iterator
â has not been declared List.h:79: error: expected …
iterator inner class in minheap
Programming
Software Development
14 Years Ago
by anders10
… } public void remove(){ throw new UnsupportedOperationException(); } } Here is the
iterator
method in the outer class. There is of course many… } public void remove(){ throw new UnsupportedOperationException(); } } Here is the
iterator
method in the outer class. There is of course many…
Iterator in java
Programming
Software Development
14 Years Ago
by prem2
….*; import java.util.Hashtable.*; import java.util.
Iterator
.*; import java.util.Enumeration.*; import java.io.*;…quot;); iobj.next(); } } } [/code] In
Iterator
declaration. What is the purpose of using the keySet…() in the
iterator
? What is keySet()? [code]
Iterator
iobj=hobj.keySet().
iterator
(); [/code] Thank you…
Re: iterator addition - How does it work?
Programming
Software Development
17 Years Ago
by vijayan121
… /*...*/ } }[/CODE] if you want to figure out what kind of
iterator
it is, use [B]std::iterator_traits<>[/B]. for…} // etc template< typename iterator_type > inline void foo( iterator_type
iterator
) { bar(
iterator
, typename iterator_traits<iterator_type>::iterator_category() ) ; } int main() {…
Re: iterator inner class in minheap
Programming
Software Development
14 Years Ago
by anders10
… away. This is the final version: public class MyListIterator implements
Iterator
<E>{ private int pos; public MyListIterator(){ pos = 0…
Iterator problem - template function
Programming
Software Development
15 Years Ago
by pac-man
…int number(int n, vector<int>::
iterator
start, vector<int>::
iterator
end) { int count = 0; for(start… I get an error message "syntax error : identifier '
iterator
'". [CODE] template <class T> int number…(T n, vector<T>::
iterator
start, vector<T>::
iterator
end) { int count = 0; for(start…
Re: Iterator in java
Programming
Software Development
14 Years Ago
by prem2
Why should not we use like the below statement? [code]
Iterator
iobj=hobj.
iterator
();[/code] Using enumeration [code]Enumeration eobj=eobj.elements();[/code]
Re: Iterator problem - template function
Programming
Software Development
15 Years Ago
by Narue
…, they became dependent types. You need to specify that
iterator
refers to a type name: [code] template <class T&…( T n, typename vector<T>::
iterator
start, typename vector<T>::
iterator
end) { int count = 0; for(start; start…
iterator deref problem
Programming
Software Development
17 Years Ago
by JRM
…experimenting with a direct method of dereferencing an
iterator
. It works OK with numbers, cout gets… troubleshooting and it came down to the
iterator
. How can this method be used with…int main() { string input; vector <string>::
iterator
itr = strv.begin(); do { getline (cin,input);…
iterator error of unknown meaning - STL map
Programming
Software Development
17 Years Ago
by FireSBurnsmuP
…'s the code: [code] for ( map<string,int>::
iterator
word = mostUsed.begin() ; word != mostUsed.end() ; word++ ) … that for-loop: [code]for( map<string,int>::
iterator
x = fauxIn.begin() ; x != fauxIn.end() ; x++…the problem, apparently[inlinecode]map<string,int>::
iterator
word = mostUsed.begin()[/inlinecode] is the problem, but…
iterator addition - How does it work?
Programming
Software Development
17 Years Ago
by FireSBurnsmuP
… any value. I want to make a second
iterator
that starts one higher than the first one. Look-see: […
Iterator to vector in a class
Programming
Software Development
15 Years Ago
by kamos.jura
I have a problem with accessing
iterator
to the vector in following code (just a few important …;Senzory*> data) { int pocet = 0; vector <Data*>::
iterator
it,ot; int stop = data.size(); int i,j,a…=1e8,b, num_del; vector<double>::
iterator
it1,it2; for(i=0;i<stop;i++) { b…
Re: iterator deref problem
Programming
Software Development
17 Years Ago
by JRM
… proposed by Fox. The fix was simply to move the
iterator
intiialization to a line AFTER the vector had been stuffed… first loop" << endl; vector <string>::
iterator
itr = strv.begin(); //put itr init here instead while (itr…
Re: iterator error of unknown meaning - STL map
Programming
Software Development
17 Years Ago
by FireSBurnsmuP
Wow, thanks! That allowed me to compile for the first time in a month. ^_^ I wouldn't have thought to make it a const_iterator instead of a regular
iterator
. Thanks!
::iterator for 2D Vector
Programming
Software Development
16 Years Ago
by Jennifer84
… the OutPut, I know I will use any kind of ::
iterator
and knowing begin() and end() of each element but I…("C:\\File1"); for( std::vector<string>::
iterator
it = 2DVector[1].begin(); it !=2DVector[1].end(); it++) { OutPut…
Re: ::iterator for 2D Vector
Programming
Software Development
16 Years Ago
by John A
…< std::vector<int> >::
iterator
iter_x; std::vector<int>::
iterator
iter_y; for (iter_x = my_vector.begin(); iter_x != my_vector…
Re: iterator index value
Programming
Software Development
15 Years Ago
by guest7
Hi, I am trying to see to which key the
iterator
is pointing in a map. is there a way to … store unique keys in a map. [CODE] mapType::
iterator
it = cube.begin(); mapType::
iterator
its = it; std::advance(its,1); for(; it…
Iterator to HashMap
Programming
Software Development
15 Years Ago
by anilopo
I want to pass all the values from a HashMap to ArrayList (that a demand of my exercise..) and to use for it an
iterator
(to the HashMap). How do I get the first key to the HashMap? (if I have the first I'll continue in a loop untill there is no "hasNext ()" to the
iterator
..)
Re: Iterator to vector in a class
Programming
Software Development
15 Years Ago
by kamos.jura
… I don't understand why I cannot access even the
iterator
with: [ICODE]it2=data.at(i)->GetData().end();[/ICODE…
Re: Iterator to vector in a class
Programming
Software Development
15 Years Ago
by mitrmkar
If you'd be allowed to do that, it would make [ICODE]const[/ICODE] quite meaningless, since you'd get a non-const
iterator
, through which you could modify the (const) vector.
Re: Iterator and vector help, with removing a string from vector?
Programming
Software Development
14 Years Ago
by mike_2000_17
… template<>'s code with the following: [CODE] TVec::
iterator
iter = std::find(v.begin(), v.end(), who); //returns the…
iterator
that matches 'who'. if(iter != v.end() ) { v.erase(iter);…be of type [ICODE]std::vector<std::string>::
iterator
[/ICODE] (or equivalently with a typedef).
Iterator doesn't reset itself
Programming
Software Development
11 Years Ago
by overflowh
…> *f1_t1 = t1.func1(); std::vector<std::string>::
iterator
iterv; for (iterv = f1_t1->begin(); iterv != f1_t1->end… of the same type (vector of strings). Then, using an
iterator
, the content of the vectors is printed out. In the…
iterator access for sum-=
Programming
Software Development
9 Years Ago
by toneranger
…'s read into my function and I'm using an
iterator
to read through as follows: int length = a; int count… googling for the right syntax to do this with the
iterator
, in this case, itr, but no luck so far. Any…
Re: iterator index value
Programming
Software Development
16 Years Ago
by minas1
[QUOTE=serkansendur;730786]is there any vay to access
iterator
's index value without using another variable in the for … main() { vector <int> vec; vector<int>::
iterator
iter; for(int i = 0; i < 5; ++i) vec…
Re: iterator index value
Programming
Software Development
16 Years Ago
by ArkM
That's just the point: a STL
iterator
is not an index value. It looks like an index … at all. In actual fact an index is a simplest
iterator
too but not vice versa.
Re: Iterator to HashMap
Programming
Software Development
15 Years Ago
by anilopo
[QUOTE=JamesCherrill;1085390]HashMap has a values() method that returns a Collection of all the values. ArrayList has a constructor that takes a Collection of values to populate the list. So all you need is a single line of code.[/QUOTE] I worked it out with an
iterator
. but maybe I'll change it eventually.. thx!
Re: Iterator and vector help, with removing a string from vector?
Programming
Software Development
14 Years Ago
by template<>
… way to remove an item from a vector using an
iterator
. [CODE] class Eraser { public: Eraser() { _vector.push_back("fred"…"); } bool remove(const std::string &who_) { for( TVec::
iterator
i=_vector.begin(); i!=_vector.end(); ++i ) { if( *i == who_…
Re: Iterator and vector help, with removing a string from vector?
Programming
Software Development
14 Years Ago
by template<>
… == who_ 3. remove item from vector using
iterator
: _vector.erase(i) [code] for( TVec::
iterator
i=_vector.begin(); i!=_vector.end(); ++i…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC