Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Determining how an EXE was started Pin
Harirajan1-Jul-08 21:18
Harirajan1-Jul-08 21:18 
GeneralRe: Determining how an EXE was started Pin
Saurabh.Garg1-Jul-08 21:25
Saurabh.Garg1-Jul-08 21:25 
GeneralRe: Determining how an EXE was started Pin
Harirajan1-Jul-08 21:56
Harirajan1-Jul-08 21:56 
GeneralRe: Determining how an EXE was started Pin
Saurabh.Garg1-Jul-08 22:14
Saurabh.Garg1-Jul-08 22:14 
GeneralRe: Determining how an EXE was started Pin
Harirajan1-Jul-08 22:18
Harirajan1-Jul-08 22:18 
QuestionHow to capture pen draw area Pin
cigogo1-Jul-08 18:03
cigogo1-Jul-08 18:03 
AnswerRe: How to capture pen draw area Pin
sashoalm1-Jul-08 20:13
sashoalm1-Jul-08 20:13 
QuestionInteresting quiz [modified] Pin
LiYS1-Jul-08 15:32
LiYS1-Jul-08 15:32 
Hi all,

I came across this quiz the other day. It goes something like: you have a string "aabbccddeffghijk" and you should find the foremost occurrence of an unique character in the string, so in this case letter 'e' should be the answer, and this should be done in just one traversing. The tip is that array index should be of interest.
I only came up with a single traversing that can only sorts out all the letters that occurred only once in the string, but how can I tell the sequence of those single occurrence of letters within single traversing, or is this possible practically:


int ar[26] = {0};
TCHAR* ptsz = "aabbccddeffghijk";
int nIndex = 0;
while (*(ptsz++))
{
    nIndex = int(*ptsz) - 'a';
    ar[nIndex]++;
}



Thanks,




modified on Tuesday, July 1, 2008 10:54 PM

AnswerRe: Interesting quiz Pin
Stephen Hewitt1-Jul-08 15:54
Stephen Hewitt1-Jul-08 15:54 
GeneralRe: Interesting quiz Pin
LiYS1-Jul-08 16:54
LiYS1-Jul-08 16:54 
AnswerRe: Interesting quiz Pin
Luc Pattyn1-Jul-08 16:26
sitebuilderLuc Pattyn1-Jul-08 16:26 
AnswerRe: Interesting quiz Pin
Stephen Hewitt1-Jul-08 17:29
Stephen Hewitt1-Jul-08 17:29 
AnswerRe: Interesting quiz Pin
David Crow2-Jul-08 5:35
David Crow2-Jul-08 5:35 
AnswerRe: Interesting quiz Pin
Iain Clarke, Warrior Programmer3-Jul-08 0:00
Iain Clarke, Warrior Programmer3-Jul-08 0:00 
QuestionDialog Box Variable Pin
bkelly131-Jul-08 12:22
bkelly131-Jul-08 12:22 
AnswerRe: Dialog Box Variable Pin
Saurabh.Garg1-Jul-08 15:04
Saurabh.Garg1-Jul-08 15:04 
GeneralRe: Dialog Box Variable Pin
bkelly131-Jul-08 15:21
bkelly131-Jul-08 15:21 
GeneralRe: Dialog Box Variable Pin
Saurabh.Garg1-Jul-08 16:32
Saurabh.Garg1-Jul-08 16:32 
GeneralRe: Dialog Box Variable Pin
cp98761-Jul-08 17:02
cp98761-Jul-08 17:02 
QuestionRe: Dialog Box Variable Pin
David Crow2-Jul-08 5:39
David Crow2-Jul-08 5:39 
AnswerRe: Dialog Box Variable Pin
bkelly133-Jul-08 15:03
bkelly133-Jul-08 15:03 
QuestionRe: Dialog Box Variable Pin
David Crow4-Jul-08 5:37
David Crow4-Jul-08 5:37 
AnswerRe: Dialog Box Variable Pin
bkelly134-Jul-08 5:51
bkelly134-Jul-08 5:51 
GeneralRe: Dialog Box Variable Pin
David Crow4-Jul-08 9:23
David Crow4-Jul-08 9:23 
AnswerRe: Dialog Box Variable Pin
cp98761-Jul-08 15:33
cp98761-Jul-08 15:33 

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.