ct
1st March 2006, 20:08
Ok.. first of all I am a bit new to STL, however I am having this problem in C++.
I have got a function defined as
int MyClass::MyString(string str[])
{
//code
}
Is there any way to find out how many elements of array are being passed to the function.
I have no way to know how many functions are being passed but only know that the constratints would be say 1 to 100 as I don't have the code that calls the function and am only supposed to write this single class.
doing (sizeof(str)/sizeof(str[0])) returns "1" and is of no use..
is there some way to find count the elements of this string array..
I have got a function defined as
int MyClass::MyString(string str[])
{
//code
}
Is there any way to find out how many elements of array are being passed to the function.
I have no way to know how many functions are being passed but only know that the constratints would be say 1 to 100 as I don't have the code that calls the function and am only supposed to write this single class.
doing (sizeof(str)/sizeof(str[0])) returns "1" and is of no use..
is there some way to find count the elements of this string array..