Results 1 to 5 of 5

Thread: silly array element counter..

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    91
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default silly array element counter..

    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..
    Last edited by ct; 1st March 2006 at 20:11.
    Humans make mistake because there is really NO patch for HUMAN STUPIDITY

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.