Форум программистов, компьютерный форум CyberForum.ru
Наши страницы

С++ для начинающих

Войти
Регистрация
Восстановить пароль
 
Skrypnyk
1 / 1 / 0
Регистрация: 15.01.2013
Сообщений: 40
#1

Чтение из файла - C++

12.05.2013, 21:50. Просмотров 660. Ответов 4
Метки нет (Все метки)

Здравствуйте.
Хочу, чтобы программа читала значения переменных из файла input.txt:
Кликните здесь для просмотра всего текста
Please choose the crystal lattice. Type 1 for BCC, 2 for FCC, and 3 for HCP: 2
Please enter lattice parameter (a): 1
For HCP please enter second lattice parameter (c): 1
Please enter the number of translated cells along X axis: 2
Please enter the number of translated cells along Y axis: 2
Please enter the number of translated cells along Z axis: 2

Более того, необходимо, чтобы считывались только цифры после двоеточия. Как это сделать?
И самое главное: программа не компилируется:
Кликните здесь для просмотра всего текста
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <iostream>
#include "Atom.h" // contains definition of class 'Atom'
#include <fstream> // to read from file
 
using namespace std;
 
int main ()
{
    int latticeType;
    int dimX, dimY, dimZ; // number of translated cells along each axis
    float d; // lattice parameter
    float h; // second lattice parameter for HCP
    Atom myAtom; // object of class 'Atom'
    ofstream inputFile; // object of class 'ofstream' to read from it
 
    inputFile.open ("input.txt", ios::in); // open 'input.txt' only for reading
    if (!inputFile){
        cerr << "Unable to open input file";
        return -1;
    }
    while (!inputFile.eof()){
        inputFile >> latticeType;
    if ( (latticeType!=1) && (latticeType!=2) && (latticeType!=3) ){}
        cerr << "Invalid value of lattice type" << endl;
        return -1;
    }
        inputFile >> d;
        if (latticeType==3){
            inputFile >> h;
        }
        inputFile >> dimX;
        inputFile >> dimY;
        inputFile >> dimZ;
    }
    inputFile.close ();
 
    if (latticeType==1) myAtom.DoBCC ( d, dimX, dimY, dimZ ); // if 1, create BCC lattice
    else if (latticeType==2) myAtom.DoFCC ( d, dimX, dimY, dimZ ); // if 2, create FCC lattice
         else  if (latticeType==3) myAtom.DoHCP ( d, h, dimX, dimY, dimZ ); // if 3, create HCP lattice
 
    return 0;
}

Пишет ошибку:
Кликните здесь для просмотра всего текста
||=== MD - Assignment 1 (revision 3), Debug ===|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp||In function 'int main()':|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|33|error: no match for 'operator>>' in 'inputFile >> latticeType'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|33|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|33|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|33|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|33|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|33|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|33|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|33|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|33|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|38|error: no match for 'operator>>' in 'inputFile >> d'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|38|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|38|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|38|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|38|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|38|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|38|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|38|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|38|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|40|error: no match for 'operator>>' in 'inputFile >> h'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|40|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|42|error: no match for 'operator>>' in 'inputFile >> dimX'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|42|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|42|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|42|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|42|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|42|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|42|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|42|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|42|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|43|error: no match for 'operator>>' in 'inputFile >> dimY'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|43|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|44|error: no match for 'operator>>' in 'inputFile >> dimZ'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|44|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|44|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|44|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|44|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|44|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|44|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|44|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|44|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|24|warning: unused variable 'myAtom' [-Wunused-variable]|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|46|error: 'inputFile' does not name a type|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|48|error: expected unqualified-id before 'if'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|49|error: expected unqualified-id before 'else'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|50|error: expected unqualified-id before 'else'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|52|error: expected unqualified-id before 'return'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\BCC_FCC_HCP.cpp|53|error: expected declaration before '}' token|
||=== Build finished: 12 errors, 1 warnings (0 minutes, 10 seconds) ===|


Добавлено через 15 минут
Обновление:
1. программа:
Кликните здесь для просмотра всего текста
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <iostream>
#include <fstream> // to read from file
 
using namespace std;
 
int main ()
{
    int latticeType;
    int dimX, dimY, dimZ; // number of translated cells along each axis
    float d; // lattice parameter
    float h; // second lattice parameter for HCP
    ofstream inputFile; // object of class 'ofstream' to read from it
 
    inputFile.open("input.txt", ios::in); // open 'input.txt' only for reading
    if (!inputFile){
        cerr << "Unable to open input file";
        return -1;
    }
    while (!inputFile.eof()){
        inputFile >> latticeType;
        cout << latticeType << endl;
    if ( (latticeType!=1) && (latticeType!=2) && (latticeType!=3) ){}
        cerr << "Invalid value of lattice type" << endl;
        return -1;
    }
        inputFile >> d;
        cout << d << endl;
        if (latticeType==3){
            inputFile >> h;
            cout << d << endl;
        }
        inputFile >> dimX;
        cout << dimX;
        inputFile >> dimY;
        cout << dimY;
        inputFile >> dimZ;
        cout << dimZ;
    }
    inputFile.close();
 
    return 0;
}

2. Ошибки:
Кликните здесь для просмотра всего текста
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp||In function 'int main()':|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|31|error: no match for 'operator>>' in 'inputFile >> latticeType'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|31|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|31|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|31|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|31|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|31|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|31|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|31|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|31|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|37|error: no match for 'operator>>' in 'inputFile >> d'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|37|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|37|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|37|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|37|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|37|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|37|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|37|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|37|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|40|error: no match for 'operator>>' in 'inputFile >> h'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|40|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|40|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|43|error: no match for 'operator>>' in 'inputFile >> dimX'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|43|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|43|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|45|error: no match for 'operator>>' in 'inputFile >> dimY'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|45|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|45|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|45|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|45|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|45|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|45|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|45|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|45|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|47|error: no match for 'operator>>' in 'inputFile >> dimZ'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|47|note: candidates are:|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.tcc|998|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|47|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|957|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|47|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\istream.tcc|925|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|47|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|725|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|47|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|730|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|47|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|772|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|47|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\istream|777|note: template argument deduction/substitution failed:|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|47|note: 'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'std::basic_istream<char, _Traits>'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|50|error: 'inputFile' does not name a type|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|52|error: expected unqualified-id before 'return'|
C:\Users\oniltech\Dropbox\CMS\Molecular Dynamics\Assignment 1\MD - Assignment 1 (revision 3)\Untitled2.cpp|53|error: expected declaration before '}' token|
||=== Build finished: 9 errors, 0 warnings (0 minutes, 10 seconds) ===|
0
Similar
Эксперт
41792 / 34177 / 6122
Регистрация: 12.04.2006
Сообщений: 57,940
12.05.2013, 21:50
Здравствуйте! Я подобрал для вас темы с ответами на вопрос Чтение из файла (C++):

Переделать в коде чтение из файла в чтение с клавиатуры - C++
Переделайте что бы текст считывался с клавиатуры, а не с файла! Буду благодарен за помощь! //файл должен начинаться со слова, между...

Чтение из файла. Повторное чтение файла - C++
Добрый день. Необходимо реализовать в программе функцию повторного чтения данных из файла, в случае некорректного ввода их в оный. Вот...

Преобразование текстового файла в двоичный и чтение исходных данных из двоичного файла. - C++
#include&lt;iostream&gt; #include&lt;fstream&gt; #include&lt;locale.h&gt; #include&lt;iomanip&gt; #include &lt;cstdlib&gt; using namespace std; struct...

Чтение нескольких структур и одной переменной из бинарного файла. Формат файла имеется - C++
Формат файла состоит из 3 структур и одной переменной. Подробное описание формата во вложении, просьба посмотреть его. У меня возникла...

как может корректно выполняющийся оператор >> (чтение из текстового файла) негативно влиять на открытие другого файла? - C++
Друзья! Создадим два текстовых файла, f_0.txt и f_1.txt и что-нибудь в них запизаем, например в первый запихаем 1234 а во второй 5678 и...

Чтение файла с несколькими знаками конца файла - C++
В файле несколько раз встречается ноль, и ни как не получается прочитать его полностью. Как можно решить данную проблему ?

Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
Olivеr
412 / 408 / 13
Регистрация: 06.10.2011
Сообщений: 831
12.05.2013, 21:51 #2
Цитата Сообщение от Skrypnyk Посмотреть сообщение
Хочу, чтобы программа читала значения переменных из файла input.txt:
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
#include <fstream>
 
using namespace std;
 
int main()
{
    int choise;
    ifstream file("text.txt");
    char c;
    while (file.good()) {
        c = file.get();
        if (c == ':') {
            c = file.get();
            c = file.get();
            choise = static_cast<int>(c) - 48;
            cout << choise;
        }
    }
 
    file.close();
    return 0;
}
1
Skrypnyk
1 / 1 / 0
Регистрация: 15.01.2013
Сообщений: 40
12.05.2013, 22:09  [ТС] #3
Olivеr, спасибо большое. Объясните мне, пожалуйста, в теле if первый раз c = file.get(); читает пробел, а второй - само число, верно? У меня проблема возникает, если я меняю числа на двух- и более значные. И почему отнимается 48?
0
Olivеr
412 / 408 / 13
Регистрация: 06.10.2011
Сообщений: 831
12.05.2013, 22:19 #4
Цитата Сообщение от Skrypnyk Посмотреть сообщение
У меня проблема возникает, если я меняю числа на двух- и более значные.
Вы писали:
Цитата Сообщение от Skrypnyk Посмотреть сообщение
чтобы считывались только цифры после двоеточия.
Цитата Сообщение от Skrypnyk Посмотреть сообщение
И почему отнимается 48?
Потому, что в ASCII коды цифр начинаются с 48.

Попробуйте так:
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <fstream>
 
using namespace std;
 
int main()
{
    int choise;
    ifstream file("text.txt");
    char c;
    while (file.good()) {
        c = file.get();
        if (c == ':') {
            file >> choise;
            cout << choise << endl;
        }
    }
    file.close();
    return 0;
}
1
Skrypnyk
1 / 1 / 0
Регистрация: 15.01.2013
Сообщений: 40
12.05.2013, 22:32  [ТС] #5
Olivеr, отлично, спасибо!

Кстати, ошибки более не актуальны. Ошибка при копипасте дала ofstream там, где нужен был ifstream, и была проблема со скобками.
0
MoreAnswers
Эксперт
37091 / 29110 / 5898
Регистрация: 17.06.2006
Сообщений: 43,301
12.05.2013, 22:32
Привет! Вот еще темы с ответами:

чтение из файла - C++
файл текст... чтение... ... char font_name = {0}; int font_size = 0;

Чтение из файла - C++
Не знаю как нормально организовать чтение чисел из файла (числа в файле расположены через запятую) пример файла: 14,79,..,4 ...

Чтение из файла - C++
Проясните, пожалуйста, один вопрос: есть файл такого содержания - 12 23 32 43 45 95 Простейшая программа: #include&lt;iostream&gt; ...

Чтение файла - C++
Как в си прочитать файл побайтово?


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
Yandex
Объявления
12.05.2013, 22:32
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Рейтинг@Mail.ru