thanks for your help.
but lets assume this following
struct test {
int value;
};
test data;
CQueue<test*> Queue;
Queue.Show(data);
template <class T> CQueue::Show(T* input) {
this function is unaware of the members of data hence i cannot do input.??? or input->???
You are right...
Hi all,
Im hoping someone might be able to assist.
If i pass a struct type to a template then i dont know the struct elements, right ?
how can i them create a sub routine to display elements of generic structs ?
Could someone please take a look at the code below and let me know why i get the following error ?
error C2660: 'Display' : function does not take 1 parameters
Error executing cl.exe.
template <class T>
class Queue
{
public:
Queue() ;
~Queue() ;
Display(int val) {...
Dear All,
I am desperately seeking a solution for the issues raised in the thread: Templates, Classes and unresolved symbols
Could someone please assist ?
hi
thanks for the input but this didnt solve the problem.
i implemented what you suggested and I recieved the same error.
the example you give shows how to pass a generic value, i need to pass both generic and specific parameters. For example
test.Display(data,1);
but i cant get the...
Ok..
i now have
template <class T> class Queue
{
public:
Queue() ;
~Queue() ;
void Display(int value){};
};
Queue<int> TItems;
int test=1;
TItems.Display(test);
SAME ERROR !!!
i have now moved all into the one header...i now have another problem
i have
template <class T> class Queue
{
public:
Queue() ;
~Queue() ;
void Display(int value);
};
template <class T> Queue<T>::Queue()
{
}
template <class T> Queue<T>::~Queue()
{
}
template <class T> void...
Dear All,
I have the following
I have created a templated class defined as
template <class T> class Queue
{
public:
Queue();
~Queue();
Display();
};
this sits in templclasses.h
and the following in templclasses.cpp
#include "stdafx.h"
#include "templclasses.h"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.