ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Общий форум

Very Unclear: С++, string
Послано Alex_SyktSU 6 ноя 2006 04:37
Quoting from FAQ:

(C++)Чтобы считать строки:

string line;
while (getline(cin, line))
{
   ...
}

Quoting from reply to email after compilation error:

ab3282a0-122f-4786-b6ac-350db0fd59d9(15): error: identifier "string" is undefined
          string te;
          ^

By the way I tried to include string or string.h headers - no matter.

So where is the truth??
Re: Very Unclear: С++, string
Послано Anton [SUrSU] 6 ноя 2006 14:02
May be you forgot to add "using namespace std"
Re: Very Unclear: С++, string
Послано Alex_SyktSU 6 ноя 2006 19:22
Ok, tried, got CE, but in addition:
576f34f4-c336-4262-9fca-d2ba8775464b(2): error: name must be a namespace
name
  using namespace std;
                  ^
Re: Very Unclear: С++, string
Послано Anton [SUrSU] 6 ноя 2006 19:35
Does this code got CE on C++?
#include <string>
using namespace std;
int main()
{
return 0;
}
Re: Very Unclear: С++, string
Послано Alex_SyktSU 6 ноя 2006 22:21
It seems I found the problem.
 If I write like this:

#include <string>
#include <iostream.h>
using namespace std;
int main()
{
return 0;
}

I get CE.

But if it's like this:

#include <string>
#include <iostream>
using namespace std;
int main()
{
return 0;
}

All works properly.

Thanks for help.