What am I doing wrong outputting this array

This is a discussion on What am I doing wrong outputting this array within the C++ Programming forums, part of the General Programming Boards category; Code: #include< iostream > #include< iomanip > #include< cstdlib > #include< ctime > #include< cstdio > #include< fstream > const ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    84

    What am I doing wrong outputting this array

    Code:
    #include< iostream >
    #include< iomanip >
    #include< cstdlib >
    #include< ctime >
    #include< cstdio >
    #include< fstream >
    
    
    const int MAXVALUES = 1000;
    using namespace std;
    
    void Bubblesort(int values);
    
    int main()
    {
        
    
    
        //Declare the streams and the input and output files
    	ifstream inFile;
        ofstream outFile;
    
    	inFile.open("A:/input1.txt");
        outFile.open("A:/output1.txt");
    
    
        int i = 0;
    	int sortValue[MAXVALUES];
    
    	while(i < MAXVALUES && inFile>> sortValue[i] )
    	{
    		i++;
    	}
    
    	for(i=0; i<MAXVALUES; i++)
    	{
    		cout>>sortValue[i];
    	}
    
    return 0;
    }
    
    void Bubblesort(int values)
    {
    
    
    }

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    Code:
    cout << sortValue[i];

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    84

    I am getting this error

    error C2676: binary '>>' : 'class std::basic_ostream<char,struct std::char_traits<char> >' does not define this operator or a conversion to a type acceptable to the pre

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    84

    never mind I got it DA!!!!!!!!!!!!!!!

    never mind I got it DA!!!!!!!!!!!!!!!

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    At least you finally got the code tags part.

  6. #6
    Registered User
    Join Date
    Aug 2001
    Posts
    84

    Comment

    I have not been on cprogramming for several months I do not remember using code tags in the past when I was posting questions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What is wrong with this 2d array?
    By FoxeySoulSLayer in forum C++ Programming
    Replies: 9
    Last Post: 04-10-2009, 04:14 PM
  2. What's wrong with my Average Array program?
    By special1zed in forum C Programming
    Replies: 12
    Last Post: 03-15-2009, 11:01 PM
  3. [question]Analyzing data in a two-dimensional array
    By burbose in forum C Programming
    Replies: 2
    Last Post: 06-13-2005, 07:31 AM
  4. Type and nontype parameters w/overloading
    By Mr_LJ in forum C++ Programming
    Replies: 3
    Last Post: 01-02-2004, 12:01 AM
  5. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 11:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21