Click here to Skip to main content
15,898,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: cout vs. printf? Pin
Rage8-Jul-03 0:42
professionalRage8-Jul-03 0:42 
GeneralRe: cout vs. printf? Pin
Rickard Andersson208-Jul-03 2:15
Rickard Andersson208-Jul-03 2:15 
GeneralRe: cout vs. printf? Pin
Rage8-Jul-03 3:23
professionalRage8-Jul-03 3:23 
GeneralRe: cout vs. printf? Pin
Ryan Binns8-Jul-03 3:50
Ryan Binns8-Jul-03 3:50 
GeneralRe: cout vs. printf? Pin
keegan8-Jul-03 3:23
keegan8-Jul-03 3:23 
AnswerRe: cout vs. printf? Pin
AlexO8-Jul-03 3:59
AlexO8-Jul-03 3:59 
GeneralRe: cout vs. printf? Pin
DaveE9th8-Jul-03 8:16
DaveE9th8-Jul-03 8:16 
Questionbinary sort function? Pin
DaveE9th7-Jul-03 23:08
DaveE9th7-Jul-03 23:08 
I have been trying alter the following program to store 13 digit numbers, so I tried to use "double" instead of "int" for my return type. It doesn't work. I want to create a sort program that can store 13 digit part numbers and display corresponding character data relating to those numbers. Is a binary sort function good for this or should I consider a different type of function? If the binary sort will work good, how do I use 13 digit double data types with this function? Thanks.
------------------------------------------------------

#include <stdio.h>
#include <stdlib.h>

int values[] = { 10, 20, 25, 40, 90, 100 };

int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}

int main ()
{
int * pItem;
int key = 40;
pItem = (int*) bsearch (&key, values, 6, sizeof (int), compare);
if (pItem!=NULL)
printf ("%d is in the array",*pItem);
else
printf ("%d is not in the array",key);
return 0;
}
AnswerRe: binary sort function? Pin
Ryan Binns7-Jul-03 23:28
Ryan Binns7-Jul-03 23:28 
GeneralRe: binary sort function? Pin
DaveE9th8-Jul-03 0:17
DaveE9th8-Jul-03 0:17 
GeneralRe: binary sort function? Pin
Ryan Binns8-Jul-03 0:23
Ryan Binns8-Jul-03 0:23 
GeneralRe: binary sort function? Pin
Rage8-Jul-03 0:23
professionalRage8-Jul-03 0:23 
GeneralRe: binary sort function? Pin
DaveE9th8-Jul-03 7:58
DaveE9th8-Jul-03 7:58 
GeneralVC++ hangs... Pin
Rage7-Jul-03 22:56
professionalRage7-Jul-03 22:56 
GeneralRe: VC++ hangs... Pin
Toni788-Jul-03 15:20
Toni788-Jul-03 15:20 
Question%1f\n? Pin
DaveE9th7-Jul-03 22:55
DaveE9th7-Jul-03 22:55 
AnswerRe: %1f\n? Pin
Rage7-Jul-03 22:59
professionalRage7-Jul-03 22:59 
AnswerRe: %1f\n? Pin
Cedric Moonen7-Jul-03 23:05
Cedric Moonen7-Jul-03 23:05 
AnswerRe: %1f\n? Pin
Rage7-Jul-03 23:05
professionalRage7-Jul-03 23:05 
GeneralRe: %1f\n? Pin
DaveE9th7-Jul-03 23:55
DaveE9th7-Jul-03 23:55 
GeneralRe: %1f\n? Pin
Rage8-Jul-03 0:39
professionalRage8-Jul-03 0:39 
GeneralRe: %1f\n? Pin
Ryan Binns8-Jul-03 0:50
Ryan Binns8-Jul-03 0:50 
GeneralRe: %1f\n? Pin
Rage8-Jul-03 1:08
professionalRage8-Jul-03 1:08 
GeneralRe: %1f\n? Pin
Ryan Binns8-Jul-03 1:11
Ryan Binns8-Jul-03 1:11 
GeneralRe: %1f\n? Pin
Rage8-Jul-03 1:12
professionalRage8-Jul-03 1:12 

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.