Click here to Skip to main content
15,891,847 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionBiometric usb mfc Pin
deeps_cute27-Mar-07 20:14
deeps_cute27-Mar-07 20:14 
AnswerRe: Biometric usb mfc Pin
Cedric Moonen27-Mar-07 20:22
Cedric Moonen27-Mar-07 20:22 
QuestionNo Subject Pin
neha.agarwal2727-Mar-07 20:00
neha.agarwal2727-Mar-07 20:00 
AnswerRe: Pin
toxcct27-Mar-07 20:30
toxcct27-Mar-07 20:30 
GeneralRe: Pin
neha.agarwal2727-Mar-07 21:03
neha.agarwal2727-Mar-07 21:03 
QuestionSearch Multiple Occurance in CRichEditCtrl Pin
MIAN KAMRAN27-Mar-07 19:53
MIAN KAMRAN27-Mar-07 19:53 
AnswerRe: Search Multiple Occurance in CRichEditCtrl Pin
prasad_som27-Mar-07 20:03
prasad_som27-Mar-07 20:03 
QuestionOffsets of the words in the file. Pin
Suresh H27-Mar-07 19:53
Suresh H27-Mar-07 19:53 
Hello All,

I am trying to read a text file & add the words and offset in to map table.

Can anyone please tell me how to calculate the offset of the words in the file ??


<code>
#include<iostream>
#include<map>
#include<string>
#include<fstream>

using namespace std;
typedef map<string,int> FileMap;

#define SIZE 255
char sBuffer[SIZE];

int main()
{
string word;
int offset;
FileMap FMap;

ifstream fin;
fin.open("D:\\Demo.txt",ios::in);

while(!fin.eof())
{
fin >> sBuffer;
// FMap[sBuffer]=offset;
}

fin.close();
cout << "\n Enter Word:";
cin >> word;
offset=FMap[word];
cout << "\n Word Offset is :" << offset;

return 0;
}
</code>

Thanking you,
Suresh HC.
AnswerRe: Offsets of the words in the file. Pin
Cedric Moonen27-Mar-07 20:06
Cedric Moonen27-Mar-07 20:06 
GeneralRe: Offsets of the words in the file. Pin
Suresh H27-Mar-07 23:05
Suresh H27-Mar-07 23:05 
Question__int64 Pin
vikramlinux27-Mar-07 19:43
vikramlinux27-Mar-07 19:43 
AnswerRe: __int64 Pin
Parthi_Appu27-Mar-07 19:50
Parthi_Appu27-Mar-07 19:50 
AnswerRe: __int64 Pin
Nibu babu thomas27-Mar-07 20:23
Nibu babu thomas27-Mar-07 20:23 
GeneralRe: __int64 Pin
vikramlinux27-Mar-07 22:37
vikramlinux27-Mar-07 22:37 
QuestionLast entered username and password for a faster login in win32 Application. Pin
amitmistry_petlad 27-Mar-07 18:52
amitmistry_petlad 27-Mar-07 18:52 
AnswerRe: Last entered username and password for a faster login in win32 Application. Pin
David Crow28-Mar-07 2:56
David Crow28-Mar-07 2:56 
GeneralRe: Last entered username and password for a faster login in win32 Application. Pin
amitmistry_petlad 28-Mar-07 17:46
amitmistry_petlad 28-Mar-07 17:46 
GeneralRe: Last entered username and password for a faster login in win32 Application. Pin
David Crow29-Mar-07 2:34
David Crow29-Mar-07 2:34 
GeneralRe: Last entered username and password for a faster login in win32 Application. Pin
amitmistry_petlad 29-Mar-07 2:42
amitmistry_petlad 29-Mar-07 2:42 
GeneralRe: Last entered username and password for a faster login in win32 Application. Pin
David Crow29-Mar-07 2:55
David Crow29-Mar-07 2:55 
GeneralRe: Last entered username and password for a faster login in win32 Application. Pin
amitmistry_petlad 29-Mar-07 2:59
amitmistry_petlad 29-Mar-07 2:59 
QuestionOnDropFiles() problem Pin
ghunzel0627-Mar-07 17:15
ghunzel0627-Mar-07 17:15 
AnswerRe: OnDropFiles() problem Pin
Parthi_Appu27-Mar-07 17:19
Parthi_Appu27-Mar-07 17:19 
GeneralRe: OnDropFiles() problem Pin
ghunzel0627-Mar-07 17:27
ghunzel0627-Mar-07 17:27 
GeneralRe: OnDropFiles() problem Pin
Parthi_Appu27-Mar-07 17:32
Parthi_Appu27-Mar-07 17:32 

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.