Iterator assertion failure. How?

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 978
Reputation: mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice 
Solved Threads: 208
mitrmkar mitrmkar is offline Offline
Posting Shark

Re: Iterator assertion failure. How?

 
0
  #11
May 17th, 2008
"." 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)
    {
    ...
}
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 47
Reputation: Cybulski is an unknown quantity at this point 
Solved Threads: 3
Cybulski's Avatar
Cybulski Cybulski is offline Offline
C++ wannabe

Re: Iterator assertion failure. How?

 
0
  #12
May 18th, 2008
Originally Posted by mitrmkar View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 978
Reputation: mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice 
Solved Threads: 208
mitrmkar mitrmkar is offline Offline
Posting Shark

Re: Iterator assertion failure. How?

 
0
  #13
May 18th, 2008
Originally Posted by Cybulski View Post
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC