|
-
September 20th, 2002, 01:37 AM
#1
A question on Knowing the data type
hi friends
I want to know the data type for a particular scenario . If anyone is aware please do reply.
example
class a
{
public:
func();
private:
char* ptr1;
wchar_t* ptr2;
};
void main()
{
a obj("Test");
char* ptr = func();
}
Explaination :
I have a class 'a' as shown above. The class can have any of the 2 pointers shown above allocated during its lifetime. The func() function in the class shown above and which is not implemented returns either a char* or a wchar_t* as per demanded by the users call to the function.
So if somebody can tell me how do i know what the user has asked for i.e. has he asked for a char* or a wchar_t*. Then knowing that i should return the specific pointer and the return type also should be dynamic.
Thanks
Paramjeet
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
|