Click here to Skip to main content
15,897,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Export Member function / class Pin
Steve Messer25-Mar-05 5:25
Steve Messer25-Mar-05 5:25 
GeneralRe: Export Member function / class Pin
Steve Messer25-Mar-05 9:51
Steve Messer25-Mar-05 9:51 
GeneralRe: Export Member function / class Pin
Steve Messer24-Mar-05 19:11
Steve Messer24-Mar-05 19:11 
GeneralRe: Export Member function / class Pin
David Crow24-Mar-05 8:38
David Crow24-Mar-05 8:38 
GeneralRe: Export Member function / class Pin
Steve Messer24-Mar-05 13:27
Steve Messer24-Mar-05 13:27 
GeneralDundas OXMultiComboBox crashes Pin
Bernhard23-Mar-05 20:01
Bernhard23-Mar-05 20:01 
Questionado can not run when WinXP update to sp2? Pin
Lido Paul23-Mar-05 19:54
Lido Paul23-Mar-05 19:54 
QuestionEnd of file? Pin
sacoskun23-Mar-05 19:49
sacoskun23-Mar-05 19:49 
Hi, I have a simple code.

#include "stdafx.h"<br />
#include <iostream><br />
using namespace std;<br />
<br />
#include <cstdlib><br />
#include <ctime><br />
typedef int DataType;<br />
<br />
void selectionSort( DataType theArray[], int n );<br />
int indexOfLargest( const DataType theArray[], int size );<br />
void mySwap( DataType& x, DataType& y );<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<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 />
      mySwap(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; ++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 mySwap( DataType& x, DataType& y )<br />
{<br />
   DataType temp = x;<br />
   x = y;<br />
   y = temp;<br />
}  // end swap


Compiler gives the error
d:\CD\myProjects\hw2Q4\hw2Q4.cpp(14): fatal error C1075: end of file found before the left brace '{' at 'd:\CD\myProjects\hw2Q4\hw2Q4.cpp(13)' was matched

There is no unmatched curly, any help would be appricated.
AnswerRe: End of file? Pin
Steve Mayfield23-Mar-05 20:28
Steve Mayfield23-Mar-05 20:28 
GeneralRe: End of file? Pin
sacoskun23-Mar-05 20:38
sacoskun23-Mar-05 20:38 
GeneralRe: End of file? Pin
toxcct23-Mar-05 22:20
toxcct23-Mar-05 22:20 
AnswerRe: End of file? Pin
eli1502197923-Mar-05 22:33
eli1502197923-Mar-05 22:33 
GeneralIt complies and links but .... Pin
brilliant10123-Mar-05 18:11
brilliant10123-Mar-05 18:11 
GeneralMFC/GDI Chart Pin
Anonymous23-Mar-05 17:54
Anonymous23-Mar-05 17:54 
GeneralCustom DateTimePicker needed Pin
Mr. Malloc23-Mar-05 17:20
Mr. Malloc23-Mar-05 17:20 
GeneralReading and Loading files Pin
Notsosuperhero23-Mar-05 15:51
Notsosuperhero23-Mar-05 15:51 
GeneralRe: Reading and Loading files Pin
David Crow23-Mar-05 16:43
David Crow23-Mar-05 16:43 
GeneralRe: Reading and Loading files Pin
Christian Graus23-Mar-05 16:45
protectorChristian Graus23-Mar-05 16:45 
GeneralRe: Reading and Loading files Pin
namaskaaram23-Mar-05 19:55
namaskaaram23-Mar-05 19:55 
GeneralMenu Item Check State Pin
Jumpin' Jeff23-Mar-05 15:22
Jumpin' Jeff23-Mar-05 15:22 
GeneralRe: Menu Item Check State Pin
Christian Graus23-Mar-05 15:42
protectorChristian Graus23-Mar-05 15:42 
GeneralRe: Menu Item Check State Pin
Jumpin' Jeff24-Mar-05 2:12
Jumpin' Jeff24-Mar-05 2:12 
GeneralSimple String Input Pin
cockytrumpet23-Mar-05 14:40
susscockytrumpet23-Mar-05 14:40 
GeneralRe: Simple String Input Pin
Christian Graus23-Mar-05 15:47
protectorChristian Graus23-Mar-05 15:47 
GeneralRe: Simple String Input Pin
cockytrumpet23-Mar-05 16:40
susscockytrumpet23-Mar-05 16:40 

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.