Click here to Skip to main content
15,896,154 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Close documents problem Pin
Stefan_Lang22-Nov-11 21:59
Stefan_Lang22-Nov-11 21:59 
GeneralRe: Close documents problem Pin
_Flaviu23-Nov-11 2:46
_Flaviu23-Nov-11 2:46 
GeneralRe: Close documents problem Pin
_Flaviu23-Nov-11 20:25
_Flaviu23-Nov-11 20:25 
QuestionMainWindow of dll how to launch from client exe Pin
appollosputnik21-Nov-11 16:06
appollosputnik21-Nov-11 16:06 
AnswerRe: MainWindow of dll how to launch from client exe Pin
Richard MacCutchan21-Nov-11 21:29
mveRichard MacCutchan21-Nov-11 21:29 
GeneralRe: MainWindow of dll how to launch from client exe Pin
appollosputnik22-Nov-11 5:11
appollosputnik22-Nov-11 5:11 
GeneralRe: MainWindow of dll how to launch from client exe Pin
Richard MacCutchan22-Nov-11 6:18
mveRichard MacCutchan22-Nov-11 6:18 
QuestionBALANCED merge sort Pin
sadas232341s21-Nov-11 10:40
sadas232341s21-Nov-11 10:40 
What does that mean, and what is the difference between just merge sort? Here is the code I use for just merge sort. How to make it BALANCED.

C++
void Merge(int arr[], int low, int high, int mid)
{
	int i, j, k, c[50];
	
	i = low;
	j = mid + 1;
	k = low;

	while((i <= mid) && (j <= high))
	{
		if(arr[i] < arr[j])
		{
			c[k] = arr[i];
			
			k++;
			i++;
		}
		else
		{
			c[k] = arr[j];
			
			k++;
			j++;
		}
	}

	while(i <= mid)
	{
		c[k] = arr[i];
		
		k++;
		i++;
	}

	while(j <= high)
	{
		c[k] = arr[j];
		
		k++;
		j++;
	}

	for(i = low; i < k; i++)
	{
		arr[i] = c[i];
	}

	UpdateData(arr, high + 1);
} 

void MergeSort(int arr[], int low, int high)
{
	int mid;
	
	if(low < high)
	{
		mid = (low + high) / 2;
		
		MergeSort(arr, low, mid);
		MergeSort(arr, mid + 1, high);
		
		Merge(arr, low, high, mid);

		SwapsCount++;
	}
}
<pre lang="c++">

QuestionCalculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 8:18
professionaljkirkerx21-Nov-11 8:18 
AnswerRe: Calculating Megabytes from ULONG Pin
Richard Andrew x6421-Nov-11 9:11
professionalRichard Andrew x6421-Nov-11 9:11 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 10:07
professionaljkirkerx21-Nov-11 10:07 
GeneralRe: Calculating Megabytes from ULONG Pin
David Crow21-Nov-11 10:30
David Crow21-Nov-11 10:30 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 10:53
professionaljkirkerx21-Nov-11 10:53 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 11:09
professionaljkirkerx21-Nov-11 11:09 
AnswerRe: Calculating Megabytes from ULONG Pin
CPallini21-Nov-11 9:50
mveCPallini21-Nov-11 9:50 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 10:09
professionaljkirkerx21-Nov-11 10:09 
AnswerRe: Calculating Megabytes from ULONG Pin
Chuck O'Toole21-Nov-11 14:48
Chuck O'Toole21-Nov-11 14:48 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 15:57
professionaljkirkerx21-Nov-11 15:57 
GeneralRe: Calculating Megabytes from ULONG Pin
Stefan_Lang22-Nov-11 3:26
Stefan_Lang22-Nov-11 3:26 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx22-Nov-11 7:00
professionaljkirkerx22-Nov-11 7:00 
QuestionCScrollBar size Pin
Omar.Pessoa21-Nov-11 4:40
Omar.Pessoa21-Nov-11 4:40 
AnswerRe: CScrollBar size Pin
Randor 21-Nov-11 5:19
professional Randor 21-Nov-11 5:19 
GeneralRe: CScrollBar size Pin
Omar.Pessoa21-Nov-11 8:07
Omar.Pessoa21-Nov-11 8:07 
Questionmemset() run time error Pin
manju 321-Nov-11 1:23
manju 321-Nov-11 1:23 
AnswerRe: memset() run time error Pin
Benjamin Bruno21-Nov-11 1:42
Benjamin Bruno21-Nov-11 1: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.