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

C++ с встроенными классами - C++

Восстановить пароль Регистрация
 
 
Рейтинг: Рейтинг темы: голосов - 10, средняя оценка - 4.60
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
17.10.2013, 15:20     C++ с встроенными классами #1
Помогите написать или найти что то аналогичное чтобы я переделал, надо преподу на зачёт (
Задание:
Написать программу на языке С++, используя какой нибудь из встроенных классов (vector, list, deque, stack, queue или priority queue) которая заполняет выбранную структуру 10 случайно сгенерированными числами от 0 до 99, выводит инициализированную структуру и и ищет в ней элементы с диапазоном от 13 до 25 (надо вывести позицию элемента в структуре и значение). Спасибо тем кто поможет!
Similar
Эксперт
41792 / 34177 / 6122
Регистрация: 12.04.2006
Сообщений: 57,940
17.10.2013, 15:20     C++ с встроенными классами
Посмотрите здесь:

Работа с классами в С++ C++
Работа с классами C++
C++ Работа с классами
C++ Работа с классами
C++ Мне необходимо создать электронную книгу, со встроенными тестами
После регистрации реклама в сообщениях будет скрыта и будут доступны все возможности форума.
MrGluck
Ворчун
Эксперт С++
 Аватар для MrGluck
4927 / 2670 / 243
Регистрация: 29.11.2010
Сообщений: 7,428
17.10.2013, 15:25     C++ с встроенными классами #2
Цитата Сообщение от ugodaj Посмотреть сообщение
Помогите написать или найти что то аналогичное
Я так понимаю речь о том, чтобы разобраться в сути вопроса и начать изучать язык даже не стоит?

Добавлено через 20 секунд
Цитата Сообщение от ugodaj Посмотреть сообщение
заполняет выбранную структуру
контейнер не структура, это шаблонный класс
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
17.10.2013, 18:21  [ТС]     C++ с встроенными классами #3
Да шаблонный класс. Да разобраться то я понял и изучать не отказываюсь вот время для того чтобы сдать задание ограничивает меня в изучении

Добавлено через 1 минуту
Мне бы хотя бы похожый код найти я бы его поредоктировал надеюсь получилось бы.
MrGluck
Ворчун
Эксперт С++
 Аватар для MrGluck
4927 / 2670 / 243
Регистрация: 29.11.2010
Сообщений: 7,428
17.10.2013, 20:01     C++ с встроенными классами #4
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
#include <iostream>
#include <vector>
#include <random>
#include <algorithm>
#include <iterator>
 
typedef std::vector<int> v_int;
typedef std::ostream_iterator<int> output_int;
 
int main()
{
    const int M = 10;
    v_int v(M), v2;
    std::mt19937 gen { std::random_device()() };
    std::uniform_int_distribution<int> uid(0, 99);
    auto print_v = [](const v_int &vec)
    {
        std::copy(std::begin(vec), std::end(vec), output_int(std::cout, " ") );
        std::cout << std::endl;
    };
 
    std::generate(std::begin(v), std::end(v), [&uid, &gen] { return uid(gen); } );
    print_v(v);
 
    std::copy_if(std::begin(v), std::end(v), std::back_inserter(v2),
        [](const int x) { return x >= 13 && x <= 25; } );
    print_v(v2);
}
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
17.10.2013, 20:58  [ТС]     C++ с встроенными классами #5
Спасибо!

Добавлено через 45 минут
Извините за тупой вопрос просто хотел уточнить... Программа работает? просто мой компилятор обычного С++ ругается на много строк или просто у меня чего то не хватает или вы мне дали самому ещё поразмыслить я просто не знаю где причину то начать искать?
MrGluck
Ворчун
Эксперт С++
 Аватар для MrGluck
4927 / 2670 / 243
Регистрация: 29.11.2010
Сообщений: 7,428
17.10.2013, 21:05     C++ с встроенными классами #6
Ваш компилятор не поддерживает С++11
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
17.10.2013, 21:09  [ТС]     C++ с встроенными классами #7
\Dev-Cpp\Untitled1.cpp C:\Dev-Cpp\C random: No such file or directory.
C:\Dev-Cpp\Untitled1.cpp In function `int main()':
14 C:\Dev-Cpp\Untitled1.cpp `mt19937' is not a member of `std'
14 C:\Dev-Cpp\Untitled1.cpp expected `;' before "gen"
15 C:\Dev-Cpp\Untitled1.cpp `uniform_int_distribution' is not a member of `std'
15 C:\Dev-Cpp\Untitled1.cpp expected primary-expression before "int"
15 C:\Dev-Cpp\Untitled1.cpp expected `;' before "int"
16 C:\Dev-Cpp\Untitled1.cpp ISO C++ forbids declaration of `print_v' with no type
16 C:\Dev-Cpp\Untitled1.cpp expected primary-expression before '[' token
16 C:\Dev-Cpp\Untitled1.cpp expected primary-expression before ']' token
16 C:\Dev-Cpp\Untitled1.cpp expected primary-expression before "const"
17 C:\Dev-Cpp\Untitled1.cpp expected `,' or `;' before '{' token
22 C:\Dev-Cpp\Untitled1.cpp `begin' is not a member of `std'
22 C:\Dev-Cpp\Untitled1.cpp `end' is not a member of `std'
22 C:\Dev-Cpp\Untitled1.cpp expected primary-expression before '[' token
22 C:\Dev-Cpp\Untitled1.cpp `uid' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
22 C:\Dev-Cpp\Untitled1.cpp `gen' undeclared (first use this function)
23 C:\Dev-Cpp\Untitled1.cpp `print_v' cannot be used as a function
25 C:\Dev-Cpp\Untitled1.cpp `copy_if' is not a member of `std'
25 C:\Dev-Cpp\Untitled1.cpp `begin' is not a member of `std'
25 C:\Dev-Cpp\Untitled1.cpp `end' is not a member of `std'
26 C:\Dev-Cpp\Untitled1.cpp expected primary-expression before '[' token
26 C:\Dev-Cpp\Untitled1.cpp expected primary-expression before ']' token
26 C:\Dev-Cpp\Untitled1.cpp expected primary-expression before "const"
27 C:\Dev-Cpp\Untitled1.cpp `print_v' cannot be used as a function

Добавлено через 31 секунду
ясно спасибо а где скачать или название чего искать?

Добавлено через 53 секунды
так и называется С++11 ?
MrGluck
Ворчун
Эксперт С++
 Аватар для MrGluck
4927 / 2670 / 243
Регистрация: 29.11.2010
Сообщений: 7,428
17.10.2013, 21:13     C++ с встроенными классами #8
С++11 - стандарт
Можете скачать Dev-cpp от Orwell, либо обновить компилятор сами, скачав его отсюда
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
18.10.2013, 00:28  [ТС]     C++ с встроенными классами #9
Помогите ещё в одном как только запускаю этот код проверить компилятором в С++ который скачал по выше указанной ссылке С++ зависает и всё! В чём проблема? на двух компах побывал, компы не слабые для такой операции...
MrGluck
Ворчун
Эксперт С++
 Аватар для MrGluck
4927 / 2670 / 243
Регистрация: 29.11.2010
Сообщений: 7,428
18.10.2013, 01:35     C++ с встроенными классами #10
ugodaj, а вы пути к компилятору прописали?
Скачали Dev-cpp от орвела или мингв?
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
18.10.2013, 11:49  [ТС]     C++ с встроенными классами #11
Сначала скачал TDM-GCC x64 4.7.1 вот этот. он быстро проверил и показал те же ошибки что и на обычном. Потом скачал этот MinGW32 4.7.2 он сразу завис при нажатии на проверку! Я нечего не прописывал в них. Я как бы не знаю где ну я заходил в опции посмотрел вроде директории инклюдес добавлены, но точно не уверен.

Добавлено через 1 минуту
А после МинГВ установил опять первый он стал также зависать
rublag
52 / 52 / 4
Регистрация: 06.02.2013
Сообщений: 156
18.10.2013, 12:31     C++ с встроенными классами #12
ugodaj, запускайте с опцией -std=c++11
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
18.10.2013, 12:56  [ТС]     C++ с встроенными классами #13
Эту опцию в начале кода прописать или где? Я понял что я нуб )

Добавлено через 6 минут
С этой функцией пошло! токо выдало #ifndef _CXX0X_WARNING_H
#define _CXX0X_WARNING_H 1

#ifndef __GXX_EXPERIMENTAL_CXX0X__
#error This file requires compiler and library support for the \
ISO C++ 2011 standard. This support is currently experimental, and must be \
enabled with the -std=c++11 or -std=gnu++11 compiler options.
#endif

#endif

Добавлено через 28 секунд
Это в МинГВ с++
rublag
52 / 52 / 4
Регистрация: 06.02.2013
Сообщений: 156
18.10.2013, 13:03     C++ с встроенными классами #14
примерно так:
g++ -std=c++11 main.cpp
где g++ - компилятор, а main.cpp - название компилируемого файла
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
18.10.2013, 13:17  [ТС]     C++ с встроенными классами #15
Как бы всё тоже самое токо пишет где компилятор g++ 1 1 "C:\Users\Dimka\Desktop\Untitled1.cpp [Error] 'g' does not name a type" А какое имя компилятора у меня где его посмотреть?

Добавлено через 3 минуты
Вот лог компилятора с этой строкой перед кодом:
General: MinGW GCC 4.7.2 32-bit Release
Executing g++.exe...
g++.exe "C:\Users\Dimka\Desktop\Untitled1.cpp" -o "C:\Users\Dimka\Desktop\Untitled1.exe" -I"C:\Program Files (x86)\Dev-Cpp\MinGW32\include" -I"C:\Program Files (x86)\Dev-Cpp\MinGW32\lib\gcc\mingw32\4.7.2\include\c++" -L"C:\Program Files (x86)\Dev-Cpp\MinGW32\lib" -L"C:\Program Files (x86)\Dev-Cpp\MinGW32\mingw32\lib" -static-libstdc++ -static-libgcc
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/random:35:0,
from C:\Users\Dimka\Desktop\Untitled1.cpp:4:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

C:\Users\Dimka\Desktop\Untitled1.cpp:1:1: error: 'gdb' does not name a type

In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:41:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:106:66: error: 'std::size_t' has not been declared

c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:108:14: error: 'size_t' in namespace 'std' does not name a type
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:112:39: error: 'std::size_t' has not been declared
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:115:57: error: 'std::size_t' has not been declared
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:118:57: error: 'std::size_t' has not been declared
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:121:35: error: 'std::size_t' has not been declared
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:147:64: error: 'std::size_t' has not been declared
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h: In static member function 'static int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)':
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:149:12: error: 'size_t' is not a member of 'std'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:149:12: note: suggested alternative:
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/../../../../include/wchar.h:26:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/cwchar:46,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/postypes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iosfwd:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:39,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/stddef.h:213:23: note: 'size_t'
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:41:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:149:24: error: expected ';' before '__i'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:149:33: error: '__i' was not declared in this scope
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h: At global scope:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:158:5: error: 'size_t' in namespace 'std' does not name a type
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:171:37: error: 'std::size_t' has not been declared
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h: In static member function 'static const char_type* __gnu_cxx::char_traits<_CharT>::find(const char_type*, int, const char_type&)':
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:173:12: error: 'size_t' is not a member of 'std'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:173:12: note: suggested alternative:
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/../../../../include/wchar.h:26:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/cwchar:46,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/postypes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iosfwd:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:39,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/stddef.h:213:23: note: 'size_t'

In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:41:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:173:24: error: expected ';' before '__i'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:173:33: error: '__i' was not declared in this scope
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h: At global scope:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:182:55: error: 'std::size_t' has not been declared
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:191:55: error: 'std::size_t' has not been declared
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/char_traits.h:201:33: error: 'std::size_t' has not been declared
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ext/new_allocator.h:34:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/c++allocator.h:34,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/allocator.h:48,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/string:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/locale_classes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/ios_base.h:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:93:31: error: declaration of 'operator new' as non-function
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:93:20: error: 'size_t' is not a member of 'std'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:93:20: note: suggested alternative:
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/../../../../include/wchar.h:26:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/cwchar:46,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/postypes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iosfwd:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:39,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/stddef.h:213:23: note: 'size_t'
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ext/new_allocator.h:34:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/c++allocator.h:34,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/allocator.h:48,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/string:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/locale_classes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/ios_base.h:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:95:33: error: declaration of 'operator new []' as non-function

c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:95:22: error: 'size_t' is not a member of 'std'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:95:22: note: suggested alternative:
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/../../../../include/wchar.h:26:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/cwchar:46,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/postypes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iosfwd:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:39,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/stddef.h:213:23: note: 'size_t'
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ext/new_allocator.h:34:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/c++allocator.h:34,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/allocator.h:48,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/string:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/locale_classes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/ios_base.h:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:101:25: error: declaration of 'operator new' as non-function
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:101:20: error: 'size_t' is not a member of 'std'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:101:20: note: suggested alternative:
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/../../../../include/wchar.h:26:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/cwchar:46,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/postypes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iosfwd:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:39,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/stddef.h:213:23: note: 'size_t'
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ext/new_allocator.h:34:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/c++allocator.h:34,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/allocator.h:48,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/string:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/locale_classes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/ios_base.h:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:101:33: error: expected primary-expression before 'const'

c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:103:27: error: declaration of 'operator new []' as non-function
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:103:22: error: 'size_t' is not a member of 'std'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:103:22: note: suggested alternative:
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/../../../../include/wchar.h:26:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/cwchar:46,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/postypes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iosfwd:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:39,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/stddef.h:213:23: note: 'size_t'
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ext/new_allocator.h:34:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/c++allocator.h:34,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/allocator.h:48,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/string:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/locale_classes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/ios_base.h:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:103:35: error: expected primary-expression before 'const'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:111:32: error: declaration of 'operator new' as non-function
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:111:27: error: 'size_t' is not a member of 'std'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:111:27: note: suggested alternative:
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/../../../../include/wchar.h:26:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/cwchar:46,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/postypes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iosfwd:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:39,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/stddef.h:213:23: note: 'size_t'
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ext/new_allocator.h:34:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/c++allocator.h:34,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/allocator.h:48,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/string:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/locale_classes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/ios_base.h:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:111:40: error: expected primary-expression before 'void'

c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:113:34: error: declaration of 'operator new []' as non-function
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:113:29: error: 'size_t' is not a member of 'std'
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:113:29: note: suggested alternative:
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/../../../../include/wchar.h:26:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/cwchar:46,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/postypes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iosfwd:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:39,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/stddef.h:213:23: note: 'size_t'
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ext/new_allocator.h:34:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/c++allocator.h:34,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/allocator.h:48,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/string:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/locale_classes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/ios_base.h:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/new:113:42: error: expected primary-expression before 'void'
In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/c++allocator.h:34:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/allocator.h:48,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/string:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/locale_classes.h:42,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/ios_base.h:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ios:43,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ostream:40,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/iostream:40,
from C:\Users\Dimka\Desktop\Untitled1.cpp:2:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ext/new_allocator.h:42:14: error: 'std::size_t' has not been declared
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/ext/new_allocator.h:43:14: error: 'std:trdiff_t' has not been declared

In file included from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_algo.h:64:0,
from c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/algorithm:63,
from C:\Users\Dimka\Desktop\Untitled1.cpp:5:
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_tempbuf.h: In function 'std:air<_Tp*, int> std::get_temporary_buffer(ptrdiff_t)':
c:\program files (x86)\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_tempbuf.h:97:20: error: too many arguments to function 'void* operator new(unsigned int)'
<built-in>:0:0: note: declared here
C:\Users\Dimka\Desktop\Untitled1.cpp: In function 'int main()':
C:\Users\Dimka\Desktop\Untitled1.cpp:15:5: error: 'mt19937' is not a member of 'std'
C:\Users\Dimka\Desktop\Untitled1.cpp:15:18: error: expected ';' before 'gen'
C:\Users\Dimka\Desktop\Untitled1.cpp:16:5: error: 'uniform_int_distribution' is not a member of 'std'
C:\Users\Dimka\Desktop\Untitled1.cpp:16:35: error: expected primary-expression before 'int'
C:\Users\Dimka\Desktop\Untitled1.cpp:16:35: error: expected ';' before 'int'
C:\Users\Dimka\Desktop\Untitled1.cpp:17:10: error: 'print_v' does not name a type
C:\Users\Dimka\Desktop\Untitled1.cpp:23:19: error: 'begin' is not a member of 'std'
C:\Users\Dimka\Desktop\Untitled1.cpp:23:34: error: 'end' is not a member of 'std'
C:\Users\Dimka\Desktop\Untitled1.cpp:23:49: error: 'uid' was not declared in this scope
C:\Users\Dimka\Desktop\Untitled1.cpp:23:55: error: 'gen' was not declared in this scope
C:\Users\Dimka\Desktop\Untitled1.cpp: In lambda function:
C:\Users\Dimka\Desktop\Untitled1.cpp:23:69: error: 'uid' is not captured
C:\Users\Dimka\Desktop\Untitled1.cpp:23:73: error: 'gen' is not captured
C:\Users\Dimka\Desktop\Untitled1.cpp:23:79: error: return-statement with a value, in function returning 'void' [-fpermissive]
C:\Users\Dimka\Desktop\Untitled1.cpp: In function 'int main()':
C:\Users\Dimka\Desktop\Untitled1.cpp:23:79: warning: lambda expressions only available with -std=c++11 or -std=gnu++11 [enabled by default]
C:\Users\Dimka\Desktop\Untitled1.cpp:24:14: error: 'print_v' was not declared in this scope
C:\Users\Dimka\Desktop\Untitled1.cpp:26:5: error: 'copy_if' is not a member of 'std'
C:\Users\Dimka\Desktop\Untitled1.cpp:26:18: error: 'begin' is not a member of 'std'
C:\Users\Dimka\Desktop\Untitled1.cpp:26:33: error: 'end' is not a member of 'std'
C:\Users\Dimka\Desktop\Untitled1.cpp:27:54: warning: lambda expressions only available with -std=c++11 or -std=gnu++11 [enabled by default]

Compilation failed after 1,70 seconds with errors

Добавлено через 24 секунды
ой не думал что так много выйдет...
rublag
52 / 52 / 4
Регистрация: 06.02.2013
Сообщений: 156
18.10.2013, 13:21     C++ с встроенными классами #16
измените настроики сборки, чтобы компилятор запускался так:
g++.exe -std=c++11 "C:\Users\Dimka\Desktop\Untitled1.cpp" -o "C:\Users\Dimka\Desktop\Untitled1.exe" -I"C:\Program Files (x86)\Dev-Cpp\MinGW32\include" -I"C:\Program Files (x86)\Dev-Cpp\MinGW32\lib\gcc\mingw32\4.7.2\include\c++" -L"C:\Program Files (x86)\Dev-Cpp\MinGW32\lib" -L"C:\Program Files (x86)\Dev-Cpp\MinGW32\mingw32\lib" -static-libstdc++ -static-libgcc
MrGluck
Ворчун
Эксперт С++
 Аватар для MrGluck
4927 / 2670 / 243
Регистрация: 29.11.2010
Сообщений: 7,428
18.10.2013, 13:24     C++ с встроенными классами #17
ugodaj, установите Dev-cpp от Orwell (ссылку я кидал выше) и не парьтесь. Там уже все прописано

Добавлено через 16 секунд
да и перед этим свой Dev-cpp надо похерить
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
18.10.2013, 13:28  [ТС]     C++ с встроенными классами #18
Ну так я так и сделал удалил свой С++ и установил тот по ссылке с МинГВ
MrGluck
Ворчун
Эксперт С++
 Аватар для MrGluck
4927 / 2670 / 243
Регистрация: 29.11.2010
Сообщений: 7,428
18.10.2013, 13:29     C++ с встроенными классами #19
Отсюда качали?
http://orwelldevcpp.blogspot.de/2013...-released.html
MoreAnswers
Эксперт
37091 / 29110 / 5898
Регистрация: 17.06.2006
Сообщений: 43,301
18.10.2013, 13:35     C++ с встроенными классами
Еще ссылки по теме:

C++ Работа с классами
C++ Работа с классами
Работа с классами C++

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

Или воспользуйтесь поиском по форуму:
ugodaj
0 / 0 / 0
Регистрация: 08.09.2012
Сообщений: 42
18.10.2013, 13:35  [ТС]     C++ с встроенными классами #20
Я зашёл на тот сайт где С++ о орвела. Там ниже Довлоадс и можно скачать 6 штук! Я кочал первый: The setup which includes MinGW32 4.7.2 can be downloaded here (25MB).

Добавлено через 37 секунд
Да именно от туда!

Добавлено через 2 минуты
При установке С++ там где предлагает выбор кеша может там надо что то другое выбрать было? Я нечего не менял только читал что выбрать можно и жал некст!
Yandex
Объявления
18.10.2013, 13:35     C++ с встроенными классами
Ответ Создать тему
Опции темы

Текущее время: 19:23. Часовой пояс GMT +3.
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Рейтинг@Mail.ru