943,914 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1445
  • C++ RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
May 17th, 2008
0

Re: Iterator assertion failure. How?

Quote ...
"." should be found and displayed, but it isn't.
You are missing the initial match ...
...
long nHandle = _findfirsti64(s_filename.c_str(), &struct_filedata);
if(nHandle >= 0)
{
    cout << "First match is: " << struct_filedata.name << '\n';
    
    while(_findnexti64(nHandle, &struct_filedata) == 0)
    {
    ...
}
Reputation Points: 1105
Solved Threads: 389
Posting Virtuoso
mitrmkar is offline Offline
1,714 posts
since Nov 2007
May 18th, 2008
0

Re: Iterator assertion failure. How?

Click to Expand / Collapse  Quote originally posted by mitrmkar ...
You are missing the initial match ...
...
long nHandle = _findfirsti64(s_filename.c_str(), &struct_filedata);
if(nHandle >= 0)
{
    cout << "First match is: " << struct_filedata.name << '\n';
    
    while(_findnexti64(nHandle, &struct_filedata) == 0)
    {
    ...
}
If you mean _findfirsti46(), then no. It isn't counted as first result. It only returns handle for future searches. In my previous implementation "." directory was displayed.
Reputation Points: 15
Solved Threads: 3
Light Poster
Cybulski is offline Offline
47 posts
since Apr 2008
May 18th, 2008
0

Re: Iterator assertion failure. How?

Click to Expand / Collapse  Quote originally posted by Cybulski ...
If you mean _findfirsti46(), then no. It isn't counted as first result.
I disagree, MSDN says ...

_findfirst, _findfirsti64, _wfindfirst, _wfindfirsti64
Provides information about the first instance of a filename that matches the file specified in the filespec argument.

http://msdn.microsoft.com/en-us/libr...69(VS.60).aspx

So, the function takes the struct _finddatai64_t * as input for a good reason.
Last edited by mitrmkar; May 18th, 2008 at 8:37 am. Reason: _finddatai64_t
Reputation Points: 1105
Solved Threads: 389
Posting Virtuoso
mitrmkar is offline Offline
1,714 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: create blank charaters (white spaces)
Next Thread in C++ Forum Timeline: bubble sort





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC