Click here to Skip to main content
15,911,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionADO, C++ database? Please help. Pin
Wamuti24-Sep-07 19:44
Wamuti24-Sep-07 19:44 
AnswerRe: ADO, C++ database? Please help. Pin
Hamid_RT24-Sep-07 20:40
Hamid_RT24-Sep-07 20:40 
GeneralRe: ADO, C++ database? Please help. Pin
Wamuti24-Sep-07 21:03
Wamuti24-Sep-07 21:03 
Questionflexigrid in VC++.net2003 help!!! Pin
manuabhi24-Sep-07 19:09
manuabhi24-Sep-07 19:09 
Questionimage drawing problem Pin
trioum24-Sep-07 19:03
trioum24-Sep-07 19:03 
AnswerRe: image drawing problem Pin
Hamid_RT24-Sep-07 19:22
Hamid_RT24-Sep-07 19:22 
AnswerRe: image drawing problem Pin
Nelek24-Sep-07 21:31
protectorNelek24-Sep-07 21:31 
AnswerRe: image drawing problem Pin
bob1697225-Sep-07 1:42
bob1697225-Sep-07 1:42 
QuestionHow to send/receive raw data to/from USB Pin
Mohammad A Gdeisat24-Sep-07 16:34
Mohammad A Gdeisat24-Sep-07 16:34 
AnswerRe: How to send/receive raw data to/from USB Pin
Cedric Moonen24-Sep-07 20:32
Cedric Moonen24-Sep-07 20:32 
Questionprogram runs and correct results, however, error messagr Pin
mrby12324-Sep-07 11:13
mrby12324-Sep-07 11:13 
AnswerRe: program runs and correct results, however, error messagr Pin
Mark Salsbery24-Sep-07 11:20
Mark Salsbery24-Sep-07 11:20 
GeneralRe: program runs and correct results, however, error messagr Pin
mrby12324-Sep-07 12:06
mrby12324-Sep-07 12:06 
GeneralRe: program runs and correct results, however, error messagr Pin
Mark Salsbery24-Sep-07 12:24
Mark Salsbery24-Sep-07 12:24 
GeneralRe: program runs and correct results, however, error messagr Pin
mrby12324-Sep-07 13:02
mrby12324-Sep-07 13:02 
QuestionRe: program runs and correct results, however, error messagr Pin
Mark Salsbery24-Sep-07 15:19
Mark Salsbery24-Sep-07 15:19 
AnswerRe: program runs and correct results, however, error messagr Pin
mrby12324-Sep-07 16:47
mrby12324-Sep-07 16:47 
GeneralRe: program runs and correct results, however, error messagr Pin
Mark Salsbery24-Sep-07 16:52
Mark Salsbery24-Sep-07 16:52 
Questionwhat kind of search is recommended??? Pin
pblais24-Sep-07 10:51
pblais24-Sep-07 10:51 
I have to do what, seems to me, is a binary search.

I have different hardware modules "out on the buss" each with its own unique 17 character ascii serial number. Initially, I don't know each's serial number and until I do, I can't communicate with them. I am going to scale down my example to 3 modules each with a 4 character wide alphanumeric (in real life each character can be any of the printable ascii characters)serial number.
Here would be the 3 units and their serial numbers..

Module # Serial #
1 ABG5
2 ABN4
3 BFT9

The way the hardware and software interface works is like this.

If I ask for any serial number starting with 'A', I will get a reply.. But I don't know how many yet.
If I ask for any serial number starting with 'B', the same holds true.
If I ask for any serial number starting with any other character other than 'A' or 'B', I don't get "a hit". Now, I can eliminate any serial numbers that don't start with the letters 'A' or 'B'

Now, I ask for serial numbers starting with 'AA' through 'AZ...A9' and get "hits" for 'AB' only.
I also run through any serial numbers starting with 'BA' through 'BZ...B9' and get one "hit" for 'BF'
This time, I eliminate anything that doesn't start with 'AB' or 'BF'

Each time I get "a hit" I don't know how many. Until I "drill" my way down through all four characters. At some point I will have only "one hit" for each of the serial numbers.

Nowwwwwwwwwwwwwwwwwwwwww.... How can I do this in Visual C++?????

As I mentioned above, I think this would be a binary search. But I am having a hard time figuring out how to "keep score" of the "non-hits" so that I don't waste time trying those on future iterations. Keeping in mind that each serial number is 17 characters wide and can be made up of any of the 95 printable ascii characters

Are there any code snippets that I can "stitch" together to do this....

Thank you in advance
Pierre





AnswerRe: what kind of search is recommended??? Pin
Waldermort24-Sep-07 19:16
Waldermort24-Sep-07 19:16 
GeneralRe: what kind of search is recommended??? Pin
pblais25-Sep-07 4:17
pblais25-Sep-07 4:17 
GeneralRe: what kind of search is recommended??? Pin
Waldermort25-Sep-07 4:40
Waldermort25-Sep-07 4:40 
GeneralRe: what kind of search is recommended??? Pin
pblais25-Sep-07 7:26
pblais25-Sep-07 7:26 
AnswerRe: what kind of search is recommended??? Pin
pblais3-Oct-07 8:50
pblais3-Oct-07 8:50 
QuestionSorry if wrong location. Trying to open unknown video type for processing. Pin
Code Monkey Mike24-Sep-07 10:41
Code Monkey Mike24-Sep-07 10:41 

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.