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

C / C++ / MFC

 
GeneralRe: Need an Algorithm Pin
Cedric Moonen3-Jun-05 0:16
Cedric Moonen3-Jun-05 0:16 
GeneralRe: Need an Algorithm Pin
toxcct3-Jun-05 0:21
toxcct3-Jun-05 0:21 
GeneralRe: Need an Algorithm Pin
Cedric Moonen3-Jun-05 1:17
Cedric Moonen3-Jun-05 1:17 
GeneralRe: Need an Algorithm Pin
camoguard3-Jun-05 4:05
camoguard3-Jun-05 4:05 
GeneralRe: Need an Algorithm Pin
Andrew Kirillov3-Jun-05 0:29
Andrew Kirillov3-Jun-05 0:29 
GeneralRe: Need an Algorithm Pin
P-Rex3-Jun-05 1:23
P-Rex3-Jun-05 1:23 
GeneralRe: Need an Algorithm Pin
Tim Smith3-Jun-05 3:43
Tim Smith3-Jun-05 3:43 
GeneralRe: Need an Algorithm Pin
toxcct3-Jun-05 0:33
toxcct3-Jun-05 0:33 
<font color=blue>int</font> iVal = 453; <font color=green>// For example</font>
<font color=blue>char</font> Result[5] = <font color=gray>""</font>;
 
<font color=blue>if</font> (iVal >= 17577) {  <font color=green>// For the most left character</font>
    Result[0] = (iVal % 26) - 1 + <font color=gray>'A'</font>;
}
<font color=blue>else</font> {
    Result[0] = <font color=gray>'\0'</font>;
}
 
<font color=blue>if</font> (iVal >= 677) {  <font color=green>// For the second left character</font>
    Result[1] = (iVal % 26) - 1 + <font color=gray>'A'</font>;
}
<font color=blue>else</font> {
    Result[1] = <font color=gray>'\0'</font>;
}
 
<font color=blue>if</font> (iVal >= 27) {  <font color=green>// For the third left character</font>
    Result[2] = (iVal % 26) - 1 + <font color=gray>'A'</font>;
}
<font color=blue>else</font> {
    Result[2] = <font color=gray>'\0'</font>;
}

<font color=blue>if</font> (iVal >= 1) {  <font color=green>// For the most right character</font>
    Result[3] = (iVal % 26) - 1 + <font color=gray>'A'</font>;
}
<font color=blue>else</font> {
    Result[3] = <font color=gray>'\0'</font>;
}
 
Result[4] = <font color=gray>'\0'</font>;
 
<font color=green>// Re-order the string (erases the '\0' at the beginning of the string)...</font>
<font color=blue>for</font> (int</font> i = 0, i < 4, i++) {
    <font color=blue>if</font> (Result[1] == <font color=gray>'\0'</font>) {
        Result[i] = Result[i+1];
    }
}

i didnot tested however... Cool | :cool:


TOXCCT >>> GEII power
[toxcct][VisualCalc]
GeneralRe: Need an Algorithm Pin
Blake Miller3-Jun-05 4:03
Blake Miller3-Jun-05 4:03 
GeneralRe: Need an Algorithm Pin
toxcct3-Jun-05 4:05
toxcct3-Jun-05 4:05 
GeneralRe: Need an Algorithm Pin
Alton Williams3-Jun-05 4:09
Alton Williams3-Jun-05 4:09 
GeneralRe: Need an Algorithm Pin
Blake Miller3-Jun-05 4:02
Blake Miller3-Jun-05 4:02 
GeneralUsing SetUnhadledExceptionFilter in COM component Pin
Poul Haahr Klemmensen2-Jun-05 23:46
Poul Haahr Klemmensen2-Jun-05 23:46 
GeneralHexadecimal to Binary Pin
mcsherry2-Jun-05 23:20
mcsherry2-Jun-05 23:20 
GeneralRe: Hexadecimal to Binary Pin
RichardS2-Jun-05 23:56
RichardS2-Jun-05 23:56 
GeneralRe: Hexadecimal to Binary Pin
mcsherry3-Jun-05 3:41
mcsherry3-Jun-05 3:41 
GeneralRe: Hexadecimal to Binary Pin
Blake Miller3-Jun-05 4:15
Blake Miller3-Jun-05 4:15 
GeneralSeeking in Large Files Pin
RichardS2-Jun-05 23:00
RichardS2-Jun-05 23:00 
GeneralRe: Seeking in Large Files Pin
Koms Bomb2-Jun-05 23:06
Koms Bomb2-Jun-05 23:06 
GeneralRe: Seeking in Large Files Pin
RichardS2-Jun-05 23:24
RichardS2-Jun-05 23:24 
GeneralRe: Seeking in Large Files Pin
Koms Bomb2-Jun-05 23:36
Koms Bomb2-Jun-05 23:36 
GeneralRe: Seeking in Large Files Pin
RichardS3-Jun-05 3:33
RichardS3-Jun-05 3:33 
GeneralRe: Seeking in Large Files Pin
David Crow3-Jun-05 3:40
David Crow3-Jun-05 3:40 
GeneralRe: Seeking in Large Files Pin
RichardS3-Jun-05 3:54
RichardS3-Jun-05 3:54 
GeneralRe: Seeking in Large Files Pin
Koms Bomb3-Jun-05 4:07
Koms Bomb3-Jun-05 4:07 

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.