Click here to Skip to main content
15,919,879 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:43
Nishad S22-Dec-05 0:43 
GeneralRe: _tcscpy Vs lstrcpy Pin
Blake Miller22-Dec-05 5:41
Blake Miller22-Dec-05 5:41 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 16:23
Nishad S22-Dec-05 16:23 
AnswerRe: _tcscpy Vs lstrcpy Pin
ThatsAlok22-Dec-05 0:53
ThatsAlok22-Dec-05 0:53 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:56
Nishad S22-Dec-05 0:56 
AnswerRe: _tcscpy Vs lstrcpy Pin
Aamir Butt22-Dec-05 18:58
Aamir Butt22-Dec-05 18:58 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 19:01
Nishad S22-Dec-05 19:01 
Questiontemplate with Iterator - some Problems Pin
tbrake22-Dec-05 0:08
tbrake22-Dec-05 0:08 
HI
I have written some class for learning and understanding ... but i got lost

At the beginning i learned "templates" the use of Iterators
Now i like to combine these Methodes

<br />
#if !defined(_TQUEUE_H_)<br />
#define _TQUEUE_H_<br />
<br />
<br />
typedef struct CPointPlus<br />
{<br />
	CPoint	m_punkt;<br />
	int	m_attribut;<br />
	float   m_freq;<br />
}CPointPlus;<br />
<br />
template <typename T><br />
class TQueue  <br />
{<br />
public:<br />
	typedef struct tqueue<br />
	{<br />
		struct tqueue *next;<br />
		T entry;<br />
		struct tqueue *prev;<br />
	}tqueue;<br />
<br />
	TQueue();<br />
	virtual ~TQueue();<br />
<br />
	void gethead();<br />
	void gettail();<br />
	// überschreiben bei aktuellem Pointer und bewegen zum nächsten<br />
	void push(T*);<br />
	T*   getnext();<br />
	T*   get();<br />
	void destroy();<br />
<br />
	class Iterator;<br />
	friend class Iterator;<br />
<br />
	long counter(){return m_count;}<br />
private:<br />
	long m_count;<br />
	tqueue *first;<br />
	tqueue *last;<br />
};<br />
<br />
template <typename T><br />
class TQueue<T>::Iterator<br />
{<br />
public:<br />
	Iterator(TQueue &tq):g(tq)<br />
	{}<br />
	~Iterator()<br />
	{}<br />
	void reset()<br />
	{<br />
		aktuell = first;<br />
	}<br />
	void next()<br />
	{<br />
		if(aktuell)<br />
		{<br />
			tqueue  *alt=aktuell;<br />
			aktuell = alt->next;<br />
		}<br />
	}<br />
	void prev()<br />
	{<br />
		if(aktuell)<br />
		{<br />
			tqueue  *alt=aktuell;<br />
			aktuell = alt->prev;<br />
		}<br />
	}<br />
	T* get()<br />
	{<br />
		if(aktuell)<br />
			return aktuell->eintrag;<br />
		return NULL;<br />
	}<br />
private:<br />
	TQueue &q;<br />
	tqueue* aktuell;<br />
};<br />
<br />



The cpp for TQueue is working fine ...

Now how to change the cpp part of Iterator to write this into TQueue.cpp??

And how to call the Iterator ??
<br />
TQueue<CPointPlus>::Iterator it(queue);<br />

is not working...

THX

LOL

T


-- modified at 6:15 Thursday 22nd December, 2005
AnswerRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 0:47
Sebastian Schneider22-Dec-05 0:47 
GeneralRe: template with Iterator - some Problems Pin
tbrake22-Dec-05 0:57
tbrake22-Dec-05 0:57 
GeneralRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 1:23
Sebastian Schneider22-Dec-05 1:23 
GeneralRe: template with Iterator - some Problems Pin
tbrake22-Dec-05 1:43
tbrake22-Dec-05 1:43 
GeneralRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 2:04
Sebastian Schneider22-Dec-05 2:04 
GeneralRe: template with Iterator - some Problems Pin
tbrake22-Dec-05 2:21
tbrake22-Dec-05 2:21 
GeneralRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 2:36
Sebastian Schneider22-Dec-05 2:36 
QuestionSTL: C2064 on sort() of a vector Pin
Sebastian Schneider21-Dec-05 23:43
Sebastian Schneider21-Dec-05 23:43 
AnswerRe: STL: C2064 on sort() of a vector Pin
toxcct22-Dec-05 0:22
toxcct22-Dec-05 0:22 
GeneralRe: STL: C2064 on sort() of a vector Pin
Sebastian Schneider22-Dec-05 0:39
Sebastian Schneider22-Dec-05 0:39 
GeneralRe: STL: C2064 on sort() of a vector Pin
toxcct22-Dec-05 2:16
toxcct22-Dec-05 2:16 
GeneralRe: STL: C2064 on sort() of a vector Pin
Sebastian Schneider22-Dec-05 2:43
Sebastian Schneider22-Dec-05 2:43 
QuestionConverting double to BYTE array Pin
ba5h33r21-Dec-05 23:36
ba5h33r21-Dec-05 23:36 
AnswerRe: Converting double to BYTE array Pin
toxcct22-Dec-05 0:20
toxcct22-Dec-05 0:20 
AnswerRe: Converting double to BYTE array Pin
kakan22-Dec-05 0:51
professionalkakan22-Dec-05 0:51 
GeneralRe: Converting double to BYTE array Pin
toxcct22-Dec-05 0:56
toxcct22-Dec-05 0:56 
GeneralRe: Converting double to BYTE array Pin
kakan22-Dec-05 1:00
professionalkakan22-Dec-05 1:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.