3 / 3 / 1
Регистрация: 20.09.2012
Сообщений: 57
1

no operator ">>" matches these operands

19.03.2013, 20:11. Показов 3867. Ответов 5
Метки нет (Все метки)

Есть код с структурой. Всё неплохо идет, вроде, но когда пытаюсь ввести массив из 5 оценок здесь :
C++
1
2
3
4
5
6
7
8
Student * Amark = new Student [iSize];
    for (int i = 0; i < a; i++) 
    {   
        for ( int j = 0; j < iSize; j++)
            cin>>Amark[j].iMark;
            
    
    }
пишет : "no operator ">>" matches these operands" и "Ошибка 1 error C2678: бинарный ">>": не найден оператор, принимающий левый операнд типа "std::istream" (или приемлемое преобразование отсутствует)
"
Помогите, что не так ? Внизу приведен код всей программы.
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
struct Student
{
    char Name [20];
    char Tname [20];
    int Age;
    int iMark [iSize];
    double Average;
};
 
int  _tmain(int argc, _TCHAR* argv[])
{
    srand ((unsigned int)time(0));
    cout<<"How many students ? "<<endl;
    int a;
    cin>>a;
    
    Student * Aname = new Student [20];
    for ( int i = 0; i < a; i++)
        cin>>Aname[i].Name;
    Student * Tname = new Student [20];
    for ( int i = 0; i < a; i++)
        cin>>Tname[i].Tname;
    Student * Aage = new Student [20];
    for ( int i = 0; i < a; i++)
        cin>>Aage[i].Age;
    Student * Amark = new Student [iSize];
    for (int i = 0; i < a; i++) 
    {   
        for ( int j = 0; j < iSize; j++)
            cin>>Amark[j].iMark;
            
    
    }
 
    return 0;
}
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
19.03.2013, 20:11
Ответы с готовыми решениями:

Вывод строки с cout: IntelliSense: no operator "<<" matches these operands
ошибку выдает 3 IntelliSense: no operator &quot;&lt;&lt;&quot; matches these operands operand types...

Error: no operator "<<" matches these operands
Чем может быть вызвана эта ошибка? cout&lt;&lt;pObj-&gt;GetName()

IntelliSense: no operator ">>" matches these operands
// Лаба 1 С++.cpp : Defines the entry point for the console application. // #include &quot;stdafx.h&quot;...

[C++] no operator">>" matches these operands
Кто может обьяснить почему компилятор показывает здесь: no operator&quot;&gt;&gt;&quot; matches these operands? ...

5
45 / 45 / 12
Регистрация: 12.03.2013
Сообщений: 167
19.03.2013, 20:14 2
Можешь хотя бы iostream подключить.
0
4004 / 3266 / 914
Регистрация: 25.03.2012
Сообщений: 12,201
Записей в блоге: 1
19.03.2013, 20:16 3
iMark это массив.
Нужно указать какой элемент массива ты вводишь.
Для массивов символов, т.е. строк Оператор >> перегружен, для остальных нет.
1
3 / 3 / 1
Регистрация: 20.09.2012
Сообщений: 57
19.03.2013, 20:17  [ТС] 4
Why so seriouS, библиотеки подключены.

Добавлено через 30 секунд
Kuzia domovenok, ну [j] же вроде, разве не так ?
0
4004 / 3266 / 914
Регистрация: 25.03.2012
Сообщений: 12,201
Записей в блоге: 1
19.03.2013, 20:18 5
Цитата Сообщение от PEVELASKA Посмотреть сообщение
for ( int j = 0; j < iSize; j++) cin>>Amark[j].iMark;
Впрочем я смотрю, ты это понимаешь и просто забыл поставить cin>>Amark[i].iMark[j];
1
3 / 3 / 1
Регистрация: 20.09.2012
Сообщений: 57
19.03.2013, 20:21  [ТС] 6
Kuzia domovenok, огромное спасибо
0
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
19.03.2013, 20:21
Помогаю со студенческими работами здесь

no operator">>" matches these operands
Кто может обьяснить почему компилятор показывает здесь: no operator&quot;&gt;&gt;&quot; matches these operands?...

No operator "[]" matches these operands
Здравствуйте. Столкнулся со следующей ошибкой - &quot;no operator &quot;&quot; matches these operands&quot; (в 7-ой и...

No operator "==" matches these operands
Может кто объяснить чем вызваны ошибки в коде? http://pastebin.com/8wu2gScd

Ошибка "invalid operands of types double and int to binary operator"
#include &lt;iostream&gt; #include &lt;math.h&gt; using namespace std; int main() { float k; int...


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

Или воспользуйтесь поиском по форуму:
6
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2023, CyberForum.ru