Click here to Skip to main content
15,886,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Making a dialog box a child of a view Pin
Mike Hankey12-Jul-08 16:27
mveMike Hankey12-Jul-08 16:27 
GeneralRe: Making a dialog box a child of a view Pin
bolivar12312-Jul-08 16:52
bolivar12312-Jul-08 16:52 
GeneralRe: Making a dialog box a child of a view Pin
Mike Hankey12-Jul-08 17:10
mveMike Hankey12-Jul-08 17:10 
GeneralRe: Making a dialog box a child of a view Pin
David Crow12-Jul-08 16:42
David Crow12-Jul-08 16:42 
QuestionHow to tokenize a string Pin
Nandu_77b12-Jul-08 10:37
Nandu_77b12-Jul-08 10:37 
AnswerRe: How to tokenize a string Pin
Saurabh.Garg12-Jul-08 19:41
Saurabh.Garg12-Jul-08 19:41 
AnswerRe: How to tokenize a string Pin
Ștefan-Mihai MOGA12-Jul-08 20:44
professionalȘtefan-Mihai MOGA12-Jul-08 20:44 
Questionhow to find a word in a string from the end? Pin
Nandu_77b12-Jul-08 8:57
Nandu_77b12-Jul-08 8:57 
Hi,

Below code shows how to get the last occurrence of a string. But in this case string::rfind reads the string from the starting and gives the last occurrence.

string str ("The sixth sick sheik's sixth sheep's sick.");
string key ("sixth");
size_t found;

found=str.rfind(key);
if (found!=string::npos)
str.replace (found,key.length(),"seventh");

cout << str << endl;

(EXAMPLE:1)


But I need a code to find the last occurrence of a string reading it from the last rather than reading it from starting. Using only string operations.
This is because I have a requirement where I need to read a string from the end, improve the performance as below shown scenario

#STAR
Data…
Data..
…………
……….
Data……
#END

We will receive a huge string (about 10mb) of data from server as show above (in the above format). To confirm that we have received the whole set of data, just check for #START and #END tag. As of now I am reading the #END using string::rfind(), which takes some time to give the result. So is there any to find a word in a string reading from end. Reading from the end will reduce the time for finding the #EDN tag.
So please proved a solution to read a string from the end.


-Nandu
AnswerRe: how to find a word in a string from the end? Pin
Luc Pattyn12-Jul-08 9:06
sitebuilderLuc Pattyn12-Jul-08 9:06 
QuestionRe: how to find a word in a string from the end? Pin
Nandu_77b12-Jul-08 9:16
Nandu_77b12-Jul-08 9:16 
AnswerRe: how to find a word in a string from the end? Pin
Luc Pattyn12-Jul-08 9:27
sitebuilderLuc Pattyn12-Jul-08 9:27 
QuestionRe: how to find a word in a string from the end? Pin
Nandu_77b12-Jul-08 10:30
Nandu_77b12-Jul-08 10:30 
AnswerRe: how to find a word in a string from the end? Pin
Bram van Kampen12-Jul-08 13:41
Bram van Kampen12-Jul-08 13:41 
QuestionConverting CString to const char* [modified] -Solved again Pin
Marc Clifton12-Jul-08 6:02
mvaMarc Clifton12-Jul-08 6:02 
AnswerRe: Converting CString to const char* [modified] -Solved again Pin
Mark Salsbery12-Jul-08 8:11
Mark Salsbery12-Jul-08 8:11 
AnswerRe: Converting CString to const char* [modified] -Solved again Pin
Nandu_77b12-Jul-08 9:05
Nandu_77b12-Jul-08 9:05 
GeneralRe: Converting CString to const char* [modified] -Solved again Pin
Marc Clifton12-Jul-08 9:11
mvaMarc Clifton12-Jul-08 9:11 
QuestionWTF: Linker can only find inline functions [modified] - Solved Pin
Marc Clifton12-Jul-08 5:34
mvaMarc Clifton12-Jul-08 5:34 
AnswerRe: WTF: Linker can only find inline functions [modified] - Solved Pin
bob1697212-Jul-08 7:11
bob1697212-Jul-08 7:11 
GeneralRe: WTF: Linker can only find inline functions [modified] - Solved Pin
Marc Clifton12-Jul-08 9:10
mvaMarc Clifton12-Jul-08 9:10 
GeneralRe: WTF: Linker can only find inline functions [modified] - Solved Pin
Bram van Kampen12-Jul-08 13:55
Bram van Kampen12-Jul-08 13:55 
AnswerRe: WTF: Linker can only find inline functions [modified] - Solved Pin
Saurabh.Garg12-Jul-08 19:58
Saurabh.Garg12-Jul-08 19:58 
GeneralRe: WTF: Linker can only find inline functions [modified] - Solved Pin
Marc Clifton13-Jul-08 3:04
mvaMarc Clifton13-Jul-08 3:04 
GeneralRe: WTF: Linker can only find inline functions [modified] - Solved Pin
Saurabh.Garg13-Jul-08 4:28
Saurabh.Garg13-Jul-08 4:28 
GeneralRe: WTF: Linker can only find inline functions [modified] - Solved Pin
Marc Clifton13-Jul-08 5:43
mvaMarc Clifton13-Jul-08 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.