Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. End of file?

End of file?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++databasequestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sacoskun
    wrote on last edited by
    #1

    Hi, I have a simple code. #include "stdafx.h" #include using namespace std; #include #include typedef int DataType; void selectionSort( DataType theArray[], int n ); int indexOfLargest( const DataType theArray[], int size ); void mySwap( DataType& x, DataType& y ); int _tmain(int argc, _TCHAR* argv[]) { return 0; } void selectionSort( DataType theArray[], int n ) { for (int last = n-1; last >= 1; --last) { int largest = indexOfLargest(theArray, last+1); // Descending order. mySwap(theArray[largest], theArray[n - last]); } // end for } // end selectionSort int indexOfLargest( const DataType theArray[], int size ) { int indexSoFar = 0; // index of largest item // found so far for (int currentIndex = 1; currentIndex < size; ++currentIndex) { // Invariant: theArray[indexSoFar] >= // theArray[0..currentIndex-1] if (theArray[currentIndex] > theArray[indexSoFar]) indexSoFar = currentIndex; } // end for return indexSoFar; // index of largest item } // end indexOfLargest void mySwap( DataType& x, DataType& y ) { DataType temp = x; x = y; y = temp; } // 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.

    S E 2 Replies Last reply
    0
    • S sacoskun

      Hi, I have a simple code. #include "stdafx.h" #include using namespace std; #include #include typedef int DataType; void selectionSort( DataType theArray[], int n ); int indexOfLargest( const DataType theArray[], int size ); void mySwap( DataType& x, DataType& y ); int _tmain(int argc, _TCHAR* argv[]) { return 0; } void selectionSort( DataType theArray[], int n ) { for (int last = n-1; last >= 1; --last) { int largest = indexOfLargest(theArray, last+1); // Descending order. mySwap(theArray[largest], theArray[n - last]); } // end for } // end selectionSort int indexOfLargest( const DataType theArray[], int size ) { int indexSoFar = 0; // index of largest item // found so far for (int currentIndex = 1; currentIndex < size; ++currentIndex) { // Invariant: theArray[indexSoFar] >= // theArray[0..currentIndex-1] if (theArray[currentIndex] > theArray[indexSoFar]) indexSoFar = currentIndex; } // end for return indexSoFar; // index of largest item } // end indexOfLargest void mySwap( DataType& x, DataType& y ) { DataType temp = x; x = y; y = temp; } // 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.

      S Offline
      S Offline
      Steve Mayfield
      wrote on last edited by
      #2

      add: #include after #include "stdafx.h" Steve

      S 1 Reply Last reply
      0
      • S Steve Mayfield

        add: #include after #include "stdafx.h" Steve

        S Offline
        S Offline
        sacoskun
        wrote on last edited by
        #3

        #include ?

        T 1 Reply Last reply
        0
        • S sacoskun

          #include ?

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          yes, read back your post..... and use the "modify" link to let us see what you really #include (dont type directly < and >, they will be interpreted as HTML tags)...


          TOXCCT >>> GEII power
          [toxcct][VisualCalc]

          1 Reply Last reply
          0
          • S sacoskun

            Hi, I have a simple code. #include "stdafx.h" #include using namespace std; #include #include typedef int DataType; void selectionSort( DataType theArray[], int n ); int indexOfLargest( const DataType theArray[], int size ); void mySwap( DataType& x, DataType& y ); int _tmain(int argc, _TCHAR* argv[]) { return 0; } void selectionSort( DataType theArray[], int n ) { for (int last = n-1; last >= 1; --last) { int largest = indexOfLargest(theArray, last+1); // Descending order. mySwap(theArray[largest], theArray[n - last]); } // end for } // end selectionSort int indexOfLargest( const DataType theArray[], int size ) { int indexSoFar = 0; // index of largest item // found so far for (int currentIndex = 1; currentIndex < size; ++currentIndex) { // Invariant: theArray[indexSoFar] >= // theArray[0..currentIndex-1] if (theArray[currentIndex] > theArray[indexSoFar]) indexSoFar = currentIndex; } // end for return indexSoFar; // index of largest item } // end indexOfLargest void mySwap( DataType& x, DataType& y ) { DataType temp = x; x = y; y = temp; } // 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.

            E Offline
            E Offline
            eli15021979
            wrote on last edited by
            #5

            kromozom wrote: #include "stdafx.h" #include using namespace std; #include #include you've missed the included file names,didn't you?:doh:

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups