Click here to Skip to main content
15,913,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Remove Backslashes Pin
prasad_som2-Apr-07 2:21
prasad_som2-Apr-07 2:21 
AnswerRe: Remove Backslashes Pin
Sachin R Sangoi2-Apr-07 1:49
Sachin R Sangoi2-Apr-07 1:49 
QuestionString search in a file(very urgent) Pin
yaminisridaran1-Apr-07 23:23
yaminisridaran1-Apr-07 23:23 
AnswerRe: String search in a file(very urgent) Pin
Rajesh R Subramanian1-Apr-07 23:42
professionalRajesh R Subramanian1-Apr-07 23:42 
GeneralRe: String search in a file(very urgent) Pin
yaminisridaran2-Apr-07 0:21
yaminisridaran2-Apr-07 0:21 
AnswerRe: String search in a file(very urgent) Pin
Parthi_Appu1-Apr-07 23:44
Parthi_Appu1-Apr-07 23:44 
GeneralRe: String search in a file(very urgent) Pin
yaminisridaran2-Apr-07 0:57
yaminisridaran2-Apr-07 0:57 
GeneralRe: String search in a file(very urgent) Pin
Parthi_Appu2-Apr-07 1:25
Parthi_Appu2-Apr-07 1:25 
yaminisridaran wrote:
I have a txt file and i want to fetch the last string of the file


Actually i donno any API for this, but i'll you an algo for this,
1) Open the File as Random file
2) Move the file pointer to end of file (using seek method)
--inside loop
3) Decrement the pointer and read a char (to read the char before, using seek method)
4) check for delimiting chars (say space, or some thing else)
5) if not a delimiting char then append the char to a string
6) decrement the file pointer (to set to previous position, using seek method)
7) goto step 3 (have to decrement again, to get previous char)
8) if its a delimiting char then break the loop.
--end of loop
Now you got the last word in the file, but it'll be in reverse. So apply strrev and get the original string..




Do your Duty and Don't expect the Result
Rate this Post, if I helped You

GeneralRe: String search in a file(very urgent) Pin
yaminisridaran2-Apr-07 1:57
yaminisridaran2-Apr-07 1:57 
GeneralRe: String search in a file(very urgent) Pin
Parthi_Appu2-Apr-07 2:06
Parthi_Appu2-Apr-07 2:06 
GeneralRe: String search in a file(very urgent) Pin
yaminisridaran2-Apr-07 2:14
yaminisridaran2-Apr-07 2:14 
GeneralRe: String search in a file(very urgent) Pin
Parthi_Appu2-Apr-07 2:22
Parthi_Appu2-Apr-07 2:22 
QuestionRe: String search in a file(very urgent) Pin
David Crow2-Apr-07 4:09
David Crow2-Apr-07 4:09 
Questionintial folder with standard class CFileDialog Pin
Ing.Raiz821-Apr-07 22:58
Ing.Raiz821-Apr-07 22:58 
AnswerRe: intial folder with standard class CFileDialog Pin
prasad_som1-Apr-07 23:18
prasad_som1-Apr-07 23:18 
GeneralRe: intial folder with standard class CFileDialog Pin
Ing.Raiz821-Apr-07 23:38
Ing.Raiz821-Apr-07 23:38 
GeneralRe: intial folder with standard class CFileDialog Pin
prasad_som1-Apr-07 23:47
prasad_som1-Apr-07 23:47 
GeneralRe: intial folder with standard class CFileDialog Pin
Ing.Raiz821-Apr-07 23:50
Ing.Raiz821-Apr-07 23:50 
QuestionRe: intial folder with standard class CFileDialog Pin
prasad_som1-Apr-07 23:56
prasad_som1-Apr-07 23:56 
AnswerRe: intial folder with standard class CFileDialog Pin
Ing.Raiz822-Apr-07 0:14
Ing.Raiz822-Apr-07 0:14 
QuestionUSB VBus disable through software Pin
shishirsingh1-Apr-07 22:57
shishirsingh1-Apr-07 22:57 
QuestionAbout Dll Export and Import Pin
siddharthsan1-Apr-07 22:42
siddharthsan1-Apr-07 22:42 
AnswerRe: About Dll Export and Import Pin
toxcct1-Apr-07 23:00
toxcct1-Apr-07 23:00 
GeneralRe: About Dll Export and Import Pin
siddharthsan2-Apr-07 0:06
siddharthsan2-Apr-07 0:06 
AnswerRe: About Dll Export and Import Pin
Eytukan1-Apr-07 23:38
Eytukan1-Apr-07 23:38 

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.