My function is not compiling....I need advice (Thanks);

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abueno
    New Member
    • May 2009
    • 16

    My function is not compiling....I need advice (Thanks);

    Code:
    void functionInputFile(ifstream& infile)
    {
        
    	string sti;   //used for ask input file.
    	string sto;   //used for ask outputfile.
    	
    	cout<<"Enter the name of the input file where you want to read";
    	cin<<sti;
    
    	cout<<"Enter the output file name: ";
    	cin<<sto;
    
    
        infile.open(sti.c_str());
        
    	if(!infile)
    	{
        cout<<"File does not exist"<<endl;
    
    	}
        
    	outfile.open(sto.c_str());
    
    }//end of function Open file.


    //Also I declared in the header of my program: #include <cstring>
    #include <ifstream>
    #include <iostream>

    and I prototype my function to as: void functionInputFi le(ifstream& infile);
    Last edited by Frinavale; Dec 9 '09, 09:54 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.
  • Airslash
    New Member
    • Nov 2007
    • 221

    #2
    can you be a bit more specific as to what error message you're recieving?

    Comment

    • abueno
      New Member
      • May 2009
      • 16

      #3
      >five.cpp
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const std::basic_stri ng<_Elem,_Trait s,_Alloc> &)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ string(537) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const std::basic_stri ng<_Elem,_Trait s,_Alloc> &)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ string(537) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const std::basic_stri ng<_Elem,_Trait s,_Alloc> &)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ string(537) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const std::basic_stri ng<_Elem,_Trait s,_Alloc> &)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ string(537) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,unsigned char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(930) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,unsigned char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(930) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,unsigned char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(930) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,unsigned char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(930) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(923) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(923) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(923) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(923) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,signed char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(916) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,signed char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(916) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,signed char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(916) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,signed char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(916) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const signed char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(909) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const signed char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(909) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const signed char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(909) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const signed char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(909) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,_Elem)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(871) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,_Elem)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(871) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,_Elem)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(871) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,_Elem)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(871) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(825) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(825) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(825) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(825) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(785) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(785) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(785) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(785) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(738) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(738) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(738) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(738) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,char)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(700) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,char)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(700) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,char)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(700) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,char)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(700) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(653) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(653) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(653) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(653) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(51) : error C2676: binary '<<' : 'std::istream' does not define this operator or a conversion to a type acceptable to the predefined operator
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const std::basic_stri ng<_Elem,_Trait s,_Alloc> &)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ string(537) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const std::basic_stri ng<_Elem,_Trait s,_Alloc> &)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ string(537) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const std::basic_stri ng<_Elem,_Trait s,_Alloc> &)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ string(537) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const std::basic_stri ng<_Elem,_Trait s,_Alloc> &)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ string(537) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,unsigned char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(930) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,unsigned char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(930) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,unsigned char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(930) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,unsigned char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(930) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(923) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(923) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(923) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(923) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,signed char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(916) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,signed char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(916) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,signed char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(916) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,signed char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(916) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const signed char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(909) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const signed char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(909) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const signed char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(909) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const signed char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(909) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,_Elem)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(871) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,_Elem)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(871) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,_Elem)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(871) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,_Elem)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(871) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(825) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(825) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(825) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(825) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(785) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(785) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(785) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,char)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(785) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(738) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(738) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(738) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<char,_Trai ts> &std::operat or <<(std::basic_o stream<char,_Tr aits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<char,_Trai ts> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(738) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,char)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(700) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,char)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(700) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,char)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(700) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,char)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(700) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(653) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(653) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(653) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2784: 'std::basic_ost ream<_Elem,_Tra its> &std::operat or <<(std::basic_o stream<_Elem,_T raits> &,const char *)' : could not deduce template argument for 'std::basic_ost ream<_Elem,_Tra its> &' from 'std::istream'
      1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ ostream(653) : see declaration of 'std::operator <<'
      1>c:\users\alfo nso\documents\v isual studio 2008\projects\f ive\five\five.c pp(54) : error C2676: binary '<<' : 'std::istream' does not define this operator or a conversion to a type acceptable to the predefined operator
      1>Build log was saved at "file://c:\Users\Alfons o\Documents\Vis ual Studio 2008\Projects\F ive\Five\Debug\ BuildLog.htm"
      1>Five - 90 error(s), 0 warning(s)
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

      Comment

      • abueno
        New Member
        • May 2009
        • 16

        #4
        so far... this is my code, included the main:
        Code:
        #include <iostream>
        #include <fstream>
        #include <string>
        #include <cstring>
        
        using namespace std;
        void functionInputFile(ifstream& infile, ofstream& outfile);
        
        struct LettersType
        {
          char CapitalLetters;  //used for count capital letters.
          char SmallLetters;    //used for count small letters.
          char compound[1000];      //used for storage all the char.
          char c;               //used for count chars.
        
        };
        
        LettersType stru;
        
        int main()
        {
          ifstream infile;
          ofstream outfile;
        	
          functionInputFile(infile,outfile);
          infile.close();
          outfile.close();
        
          return 0;
        }
        
        
        
        void functionInputFile(ifstream& infile, ofstream& outfile)
        {  string sti;   //used for ask input file.
          string sto;   //used for ask outputfile.
          cout<<"Enter the name of the input file where you want to read";
          cin<<sti;
          cout<<"Enter the output file name: ";
          cin<<sto;
        
          infile.open(sti.c_str());
            
          if(!infile)
          {
            cout<<"File does not exist"<<endl;
          }
            
          outfile.open(sto.c_str());
        }//end of function Open file.
        Last edited by Frinavale; Dec 9 '09, 09:54 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.

        Comment

        • solita
          New Member
          • Jun 2009
          • 17

          #5
          use >> for cin.-----------------------------------------------------------------

          Comment

          • weaknessforcats
            Recognized Expert Expert
            • Mar 2007
            • 9214

            #6
            #include <cstring> is for C and not C++. It is the string.h of C.

            You need to #include <string> for C++. It is there the operator<< declarations are found.

            There should be no C header files used in your code. The C++ equivalents of the C headers have remopved the .h and replaced it with a leading c in the header file name.

            Comment

            • abueno
              New Member
              • May 2009
              • 16

              #7
              Thank you to everybody that replied, I got it working now......

              Comment

              Working...