I am implementing a program where I want to store only certain part of the input string.
for eg if the input string is
0123456789
I want to discard 4 AND 7
and store
01235689
Please my program requires an input string of 10000 characters so running time is very crucial for me.
Also while inputting the string I really don't know how many characters will be there.
Does anybody have any suggestions?
Any help will be greatly appreciated
swissknife007
3
Junior Poster in Training
Recommended Answers
Jump to PostDepends, what is the criteria for discarding characters.
Jump to PostSorry but you didnt understand my question.i dont want to stop reading once i encounter 4 or 7.I want to continue reading the rest of the string
Yes I understood your question. You use the function memchr to find the occurrence of characters(or pointers to the occurrences) to find ranges(pointer …
All 8 Replies
gerard4143
371
Nearly a Posting Maven
swissknife007
3
Junior Poster in Training
swissknife007
3
Junior Poster in Training
gerard4143
371
Nearly a Posting Maven
swissknife007
3
Junior Poster in Training
gerard4143
371
Nearly a Posting Maven
L7Sqr
227
Practically a Master Poster
mhd_arif123
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.