943,887 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1449
  • C RSS
May 31st, 2005
0

Identify series of a string

Expand Post »
If your input is "abc". What would be the logic to accept the strings, bca,acb,bac,cab,cba,abc (ie. the same string with chars placed in any order)
and reject all other input strings like aab, cdb, xyz etc ?
Note: The reference string("abc") is not fixed, logic should work for any constant string irrespective of its size.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
swets_here is offline Offline
4 posts
since May 2005
May 31st, 2005
0

Re: Identify series of a string

the string class has a function, find_first_not_of( ), where you can just give it your original string "abc". It searches to find any characters that aren't in the list of the ones you provided. (you would want it to return -1 which means it didn't find any)
Reputation Points: 68
Solved Threads: 18
Posting Pro in Training
winbatch is offline Offline
466 posts
since Feb 2005
Jun 3rd, 2005
0

Re: Identify series of a string

Thanks! I tried using it but the compiler fails to recognize this function. Is it present in the stdlib?

Is the usage like,
check_flag = find_first_not_of(abc) ;
//where to I give the string to be compared?

Can you pls gimme the exact protype for this function find_first_not_of( )?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
swets_here is offline Offline
4 posts
since May 2005
Jun 3rd, 2005
0

Re: Identify series of a string

Reputation Points: 68
Solved Threads: 18
Posting Pro in Training
winbatch is offline Offline
466 posts
since Feb 2005

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: VNC Help!
Next Thread in C Forum Timeline: :: help required for ftp server implementation::





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


Follow us on Twitter


© 2011 DaniWeb® LLC