|
-
April 12th, 2004, 11:43 AM
#1
copying unknown datatypes
I have a variable in a templated class (A) that I want to be able to change from a wrapper class (B). The data type of A changes with each instance (string, int, float...), but what I'm wondering is if I can create a universal member function in B that will set the value in A?
would it be possible to
a = malloc(sizeof(*newVal));
strcpy(a, newVal);
where
template <class T>
class A
{
public:
T * a;
}
and
void * newVal;
is this possible? and am I making sense?
Last edited by DevLip; April 12th, 2004 at 12:00 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|