Cyber-Drugs
asked on
Calling a Function
Hi guys,
I have this function:
ExecuteScriptFunction(cons t CString strFunc, const CStringArray& paramArray)
How would I call it?
String value, Array
String value, lots of string values
?
Cheers!
I have this function:
ExecuteScriptFunction(cons
How would I call it?
String value, Array
String value, lots of string values
?
Cheers!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
why not to use VARIABLE ARGUMENT FUNCTION with which you can pass unlimited no. (varaible) of arguments to function....just like printf().. as you know you may pass any no. of arguments to printf().. you may also have such type of function...
so that in function itself you may pass any no. strings as parameters like :
ExecuteScriptFunction(cons t CString strFunc, strArg1,strArg2,strArg3... ...)
Look here for how to declare and define them :
http://www.codeproject.com/cpp/argfunctions.asp
http://www.codeguru.com/cpp/cpp/cpp_mfc/functions/article.php/c4025/
-MAHESH
so that in function itself you may pass any no. strings as parameters like :
ExecuteScriptFunction(cons
Look here for how to declare and define them :
http://www.codeproject.com/cpp/argfunctions.asp
http://www.codeguru.com/cpp/cpp/cpp_mfc/functions/article.php/c4025/
-MAHESH
more simple example related to variable argument is here :
http://www.codeproject.com/cpp/C___Variable_Arguments.asp
-MAHESH
http://www.codeproject.com/cpp/C___Variable_Arguments.asp
-MAHESH
ASKER
Hi Mahesh,
Thank you for all the detailed links, and I will be reading them to learn a few new tricks, but for this question I'm basically looking for something I can cut and paste into C++ to test if the function works properly...
As you helped write the function, maybe you could show me how to use it?
Cheers!
Thank you for all the detailed links, and I will be reading them to learn a few new tricks, but for this question I'm basically looking for something I can cut and paste into C++ to test if the function works properly...
As you helped write the function, maybe you could show me how to use it?
Cheers!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I suppose what I meant was...
How do I populate a CStringArray?
Cheers!