Click here to Skip to main content
15,893,564 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDialog box question Pin
Jump_Around28-May-03 0:12
Jump_Around28-May-03 0:12 
GeneralRe: Dialog box question Pin
Rage28-May-03 1:14
professionalRage28-May-03 1:14 
GeneralRe: Dialog box question Pin
Jump_Around29-May-03 1:40
Jump_Around29-May-03 1:40 
Generalnamespaces problem ... Pin
flybird27-May-03 21:48
flybird27-May-03 21:48 
GeneralRe: namespaces problem ... Pin
Rage28-May-03 1:16
professionalRage28-May-03 1:16 
GeneralFile searching Pin
Shah Shehpori27-May-03 21:21
sussShah Shehpori27-May-03 21:21 
GeneralRe: File searching Pin
David Crow28-May-03 3:11
David Crow28-May-03 3:11 
GeneralRe: File searching Pin
Dudi Avramov28-May-03 3:13
Dudi Avramov28-May-03 3:13 
Well,
the idea is not to compare words but characters and implement something
as state machine.
For the word "codeproject" you expect for 'c'.
if the read character equals to 'c' then you know that you expect for 'o'.
If the read character is not 'o' then you return back to expect for 'c'.

Check the following sample (where the search is case-sensitive)

suppose the file is loaded to a buffer pointed by pData.
char *pStart = "codeproject";
char *p = pStart;

int nFound = 0;

for (int i=0;i<file_length;i++)
{
	if (*p == NULL)     // 'codeproject' was found
	{
		nFound++;
		p = pStart;
		continue;
	}
	if (*p == pData[i])
		p++;
	else
		p = pStart;
}

QuestionHow to 'talk' to an OPC server Pin
Vassili27-May-03 21:03
Vassili27-May-03 21:03 
Generaldisable/enable network adapter card on NT4 Pin
Member 36342727-May-03 20:34
Member 36342727-May-03 20:34 
GeneralRe: disable/enable network adapter card on NT4 Pin
David Crow28-May-03 4:30
David Crow28-May-03 4:30 
Generalstatic function access member variable and member function Pin
yccheok27-May-03 20:09
yccheok27-May-03 20:09 
GeneralRe: static function access member variable and member function Pin
Daniel Strigl27-May-03 20:25
Daniel Strigl27-May-03 20:25 
GeneralRe: static function access member variable and member function Pin
John R. Shaw27-May-03 20:59
John R. Shaw27-May-03 20:59 
GeneralRe: static function access member variable and member function Pin
John R. Shaw27-May-03 20:47
John R. Shaw27-May-03 20:47 
GeneralQuestion for the strong Pin
aguest27-May-03 19:17
aguest27-May-03 19:17 
GeneralRe: Question for the strong Pin
John R. Shaw27-May-03 19:53
John R. Shaw27-May-03 19:53 
GeneralRe: Question for the strong Pin
qweas27-May-03 19:56
qweas27-May-03 19:56 
GeneralRe: Question for the strong Pin
aguest27-May-03 22:30
aguest27-May-03 22:30 
GeneralRe: Question for the strong Pin
Rage28-May-03 1:21
professionalRage28-May-03 1:21 
GeneralRe: Question for the strong Pin
MemLeak28-May-03 2:58
MemLeak28-May-03 2:58 
GeneralRe: Question for the strong Pin
aguest28-May-03 6:20
aguest28-May-03 6:20 
GeneralRe: Question for the strong Pin
aguest28-May-03 6:29
aguest28-May-03 6:29 
GeneralRe: Question for the strong Pin
MemLeak29-May-03 5:24
MemLeak29-May-03 5:24 
GeneralCaputuring all keystrokes Pin
SAK27-May-03 18:42
SAK27-May-03 18:42 

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.