Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC Chart Pin
David Crow23-Mar-05 16:48
David Crow23-Mar-05 16:48 
GeneralRe: MFC Chart Pin
Coremn23-Mar-05 16:53
Coremn23-Mar-05 16:53 
GeneralOpenGL and CView problem Pin
FayezElFar23-Mar-05 11:50
FayezElFar23-Mar-05 11:50 
GeneralRe: OpenGL and CView problem Pin
Alexander M.,23-Mar-05 12:19
Alexander M.,23-Mar-05 12:19 
GeneralRe: OpenGL and CView problem Pin
FayezElFar24-Mar-05 4:25
FayezElFar24-Mar-05 4:25 
GeneralSimple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:01
sacoskun23-Mar-05 10:01 
GeneralRe: Simple error, but how to solve?:( Pin
PJ Arends23-Mar-05 10:09
professionalPJ Arends23-Mar-05 10:09 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:21
sacoskun23-Mar-05 10:21 
Ohh my goodness, I should take a sleep. Thank you friend. I have modified the code as;
#include <iostream><br />
<br />
using namespace std;<br />
typedef int DataType;<br />
<br />
int indexOfLargest(const DataType theArray[], int size);<br />
void selectionSort(DataType theArray[], int n);<br />
void swap(DataType& x, DataType& y);<br />
<br />
int main()<br />
{<br />
	return 0;<br />
}<br />
<br />
void selectionSort(DataType theArray[], int n)<br />
{<br />
   for (int last = n-1; last >= 1; --last)<br />
   {  <br />
	  int largest = indexOfLargest(theArray, last+1);<br />
<br />
	  // Descending order.<br />
      swap(theArray[largest], theArray[n - last]);<br />
<br />
   }  // end for<br />
}  // end selectionSort<br />
<br />
int indexOfLargest(const DataType theArray[], int size)<br />
{<br />
   int indexSoFar = 0;  // index of largest item <br />
                        // found so far<br />
   for (int currentIndex = 1; currentIndex < size; <br />
                              ++currentIndex)<br />
   {  // Invariant: theArray[indexSoFar] >= <br />
      //            theArray[0..currentIndex-1]<br />
     if (theArray[currentIndex] > theArray[indexSoFar])<br />
         indexSoFar = currentIndex;<br />
   }  // end for<br />
<br />
   return indexSoFar;  // index of largest item<br />
}  // end indexOfLargest<br />
<br />
void swap(DataType& x, DataType& y)<br />
{<br />
   DataType temp = x;<br />
   x = y;<br />
   y = temp;<br />
}  // end swap<br />


But this time I get the error of

d:\CD\myProjects\Homeworks\hw2Q4\hw2Q4.cpp(11): fatal error C1075: end of file found before the left brace '{' at 'd:\CD\myProjects\Homeworks\hw2Q4\hw2Q4.cpp(10)' was matched

How can I solve this one? Thanks...
GeneralRe: Simple error, but how to solve?:( Pin
Barry Etter23-Mar-05 10:39
Barry Etter23-Mar-05 10:39 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:43
sacoskun23-Mar-05 10:43 
GeneralRe: Simple error, but how to solve?:( Pin
Barry Etter23-Mar-05 10:53
Barry Etter23-Mar-05 10:53 
GeneralRe: Simple error, but how to solve?:( Pin
PJ Arends23-Mar-05 10:55
professionalPJ Arends23-Mar-05 10:55 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 11:15
sacoskun23-Mar-05 11:15 
GeneralRe: Simple error, but how to solve?:( Pin
Serge Krynine23-Mar-05 11:54
Serge Krynine23-Mar-05 11:54 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 18:13
sacoskun23-Mar-05 18:13 
GeneralNeed some direction Pin
Tom Wright23-Mar-05 9:55
Tom Wright23-Mar-05 9:55 
GeneralRe: Need some direction Pin
PJ Arends23-Mar-05 10:59
professionalPJ Arends23-Mar-05 10:59 
GeneralRe: Need some direction Pin
Tom Wright23-Mar-05 11:21
Tom Wright23-Mar-05 11:21 
Questionneed a tool (or api) that creates login attempts to an active directory domain?? Pin
vista2723-Mar-05 9:25
vista2723-Mar-05 9:25 
AnswerRe: need a tool (or api) that creates login attempts to an active directory domain?? Pin
Blake Miller23-Mar-05 11:43
Blake Miller23-Mar-05 11:43 
QuestionHow to detect Network Cable Unplug Events Pin
Paolo Ponzano23-Mar-05 8:36
Paolo Ponzano23-Mar-05 8:36 
AnswerRe: How to detect Network Cable Unplug Events Pin
David Crow23-Mar-05 9:45
David Crow23-Mar-05 9:45 
GeneralHardware list error Pin
brilliant10123-Mar-05 8:10
brilliant10123-Mar-05 8:10 
GeneralRe: Hardware list error Pin
David Crow23-Mar-05 9:47
David Crow23-Mar-05 9:47 
GeneralSocket programming Pin
vinsankar23-Mar-05 6:55
vinsankar23-Mar-05 6:55 

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.