Error begin was not declared in this scope

I'm trying to learn c++, so I wrote a short program that uses the new c++11 for loop, which makes the compiler give me an error I don't understand. this is my c++ code: #include #

I’m trying to learn c++, so I wrote a short program that uses the new c++11 for loop, which makes the compiler give me an error I don’t understand.
this is my c++ code:

#include <iostream>
#include <cmath>
using namespace std;

float legge_oraria_moto_accelerato(float a[3]){
    return a[2]*a[0] + 0.5*a[1]*a[0]*a[0];
}
int corri(float (f)(float array[3]), float arrays[3][3])
    { for(auto i:arrays) cout << f(i) << 'n';
    return 0;
} 

int main()
{ 
return 0;
}

and this is the compiler’s (g++ -std=gnu++11) error:

mezzo.cpp: In function ‘int corri(float (*)(float*), float (*)[3])’:
mezzo.cpp:9:18: error: ‘begin’ was not declared in this scope
     { for(auto i:arrays) cout << f(i) << 'n';
                  ^
mezzo.cpp:9:18: note: suggested alternatives:
In file included from /usr/include/c++/4.9/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.9/string:52,
                 from /usr/include/c++/4.9/bits/locale_classes.h:40,
                 from /usr/include/c++/4.9/bits/ios_base.h:41,
                 from /usr/include/c++/4.9/ios:42,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/c++/4.9/iostream:39,
                 from mezzo.cpp:1:
/usr/include/c++/4.9/initializer_list:89:5: note:   ‘std::begin’
     begin(initializer_list<_Tp> __ils) noexcept
     ^
/usr/include/c++/4.9/initializer_list:89:5: note:   ‘std::begin’
mezzo.cpp:9:18: error: ‘end’ was not declared in this scope
     { for(auto i:arrays) cout << f(i) << 'n';
                  ^
mezzo.cpp:9:18: note: suggested alternatives:
In file included from /usr/include/c++/4.9/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.9/string:52,
                 from /usr/include/c++/4.9/bits/locale_classes.h:40,
                 from /usr/include/c++/4.9/bits/ios_base.h:41,
                 from /usr/include/c++/4.9/ios:42,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/c++/4.9/iostream:39,
                 from mezzo.cpp:1:
/usr/include/c++/4.9/initializer_list:99:5: note:   ‘std::end’
     end(initializer_list<_Tp> __ils) noexcept
     ^
/usr/include/c++/4.9/initializer_list:99:5: note:   ‘std::end’

Hi, newbie here. I’m playing around with programming by using an Arduino to control ARGB lighting strips.

I have the following function:

void Fade_multi (int sleds[], int steps, int speed, int red, int green, int blue) {
    for (int st = 0; st < steps; st++) {
      for (int x : sleds) {
        if (sleds [st] = 1) {
            Fade_steps(steps,speed,x,x,red,green,blue);
        }
      }
    }
}

When I compile my code, I get the following error:

'begin' was not declared in this scope

I assume that the error is related to the function I am calling in this function, which is:

void Fade_steps(int steps, int speed, int begin, int end, int red, int green, int blue) {
  for (int s = 0; s < steps; s++) {
    for (int v = 0; v < speed; v++) {
      Fade_one_step_to_colour(begin, end, red, green, blue);
    }
  FastLED.delay(1);
  }
}

This piece of code hasn’t caused issues with compiling itself — when I comment the Fade_multi function out it compiles without issue.

I think this might have something to do with the variable begin not being declared in Fade_multi, but I’m also not calling it there. So I am a bit confused as to the cause of this error.

Edit: full code: https://pastebin.com/ffXkuD9u

🐛 Bug

The example for ModuleList found in the documentation here does not seem to compile.

To Reproduce

Steps to reproduce the behavior:

Attempt to compile the following source on GCC 7.4, taken from the documentation:

#include <torch/torch.h>

int main() {

  torch::nn::ModuleList mlist(
    torch::nn::Linear(3, 4),
    torch::nn::BatchNorm(4),
    torch::nn::Dropout(0.5)
  );

  for (const auto &module : mlist) {
    module.pretty_print();
}

Compile error:

C++ compilation of rule '//src/learning:pytorch' failed (Exit 1) gcc failed: error executing command /usr
/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 38 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
src/learning/pytorch_test.cpp: In function 'int main()':
src/learning/pytorch_test.cpp:12:29: error: 'begin' was not declared in this scope
   for (const auto &module : mlist) {
                             ^~~~~
src/learning/pytorch_test.cpp:12:29: note: suggested alternative:
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from external/pytorch/libtorch/include/c10/core/Allocator.h:4,
                 from external/pytorch/libtorch/include/ATen/ATen.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/types.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/all.h:4,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/torch.h:3,
                 from src/learning/pytorch_test.cpp:1:
/usr/include/c++/7/bits/range_access.h:105:37: note:   'std::begin'
   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&);
                                     ^~~~~
src/learning/pytorch_test.cpp:12:29: error: 'end' was not declared in this scope
   for (const auto &module : mlist) {
                             ^~~~~
src/learning/pytorch_test.cpp:12:29: note: suggested alternatives:
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from external/pytorch/libtorch/include/c10/core/Allocator.h:4,
                 from external/pytorch/libtorch/include/ATen/ATen.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/types.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/all.h:4,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/torch.h:3,
                 from src/learning/pytorch_test.cpp:1:
/usr/include/c++/7/bits/range_access.h:107:37: note:   'std::end'
   template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
                                     ^~~
In file included from external/pytorch/libtorch/include/ATen/core/Dimname.h:5:0,
                 from external/pytorch/libtorch/include/ATen/core/NamedTensor.h:4,
                 from external/pytorch/libtorch/include/ATen/core/TensorBody.h:20,
                 from external/pytorch/libtorch/include/ATen/Tensor.h:11,
                 from external/pytorch/libtorch/include/ATen/Context.h:4,
                 from external/pytorch/libtorch/include/ATen/ATen.h:5,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/types.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/data.h:3,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/all.h:4,
                 from external/pytorch/libtorch/include/torch/csrc/api/include/torch/torch.h:3,
                 from src/learning/pytorch_test.cpp:1:
external/pytorch/libtorch/include/ATen/core/interned_strings.h:374:1: note:   'c10::attr::end'
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
external/pytorch/libtorch/include/ATen/core/interned_strings.h:374:1: note:   'c10::attr::end'
src/learning/pytorch_test.cpp:14:1: error: expected '}' at end of input
 }

Expected behavior

I believe this should pretty print the submodules…

Environment

  • GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
  • PyTorch Version (e.g., 1.0): 1.4
  • OS (e.g., Linux): Ubuntu 18.04.1 LTS
  • How you installed PyTorch (conda, pip, source): Linux CPU-only binary
  • Build command you used (if compiling from source): n/a
  • Python version: n/a
  • CUDA/cuDNN version: n/a
  • GPU models and configuration: n/a
  • Any other relevant information: Using GCC 7 via Bazel (see trace above for full compile flags)

Additional context

Also, is there way to initialize an empty ModuleList an do operations on it? If I try to push_back on an empty ModuleList I get what(): Accessing empty ModuleHolder (get at external/pytorch/libtorch/include/torch/csrc/api/include/torch/nn/pimpl.h:107) which makes it not so useful for my use-case of creating variable sized networks at runtime.

cc @yf225

Im learning c++ 11 and i found this error

#include<SFML/Graphics.hpp>

int main()
{
        sf::VertexArray a;
        for(auto& b:a)
        {

                }
}

error when compiled with GCC

g++ test.cpp -o test -lsfml-graphics -lsfml-window -lsfml-system -std=c++11
test.cpp: In function ‘int main()’:
test.cpp:6:14: error: ‘begin’ was not declared in this scope
  for(auto& b:a)
              ^
test.cpp:6:14: note: suggested alternative:
In file included from /usr/include/c++/4.9/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.9/string:52,
                 from /usr/include/c++/4.9/bits/locale_classes.h:40,
                 from /usr/include/c++/4.9/bits/ios_base.h:41,
                 from /usr/include/c++/4.9/ios:42,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/SFML/System/Err.hpp:32,
                 from /usr/include/SFML/System.hpp:34,
                 from /usr/include/SFML/Window.hpp:32,
                 from /usr/include/SFML/Graphics.hpp:32,
                 from test.cpp:1:
/usr/include/c++/4.9/initializer_list:89:5: note:   ‘std::begin’
     begin(initializer_list<_Tp> __ils) noexcept
     ^
test.cpp:6:14: error: ‘end’ was not declared in this scope
  for(auto& b:a)
              ^
test.cpp:6:14: note: suggested alternative:
In file included from /usr/include/c++/4.9/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.9/string:52,
                 from /usr/include/c++/4.9/bits/locale_classes.h:40,
                 from /usr/include/c++/4.9/bits/ios_base.h:41,
                 from /usr/include/c++/4.9/ios:42,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/SFML/System/Err.hpp:32,
                 from /usr/include/SFML/System.hpp:34,
                 from /usr/include/SFML/Window.hpp:32,
                 from /usr/include/SFML/Graphics.hpp:32,
                 from test.cpp:1:
/usr/include/c++/4.9/initializer_list:99:5: note:   ‘std::end’
     end(initializer_list<_Tp> __ils) noexcept
     ^

error when compiled with clang

clang++ test.cpp -o test -lsfml-graphics -lsfml-window -lsfml-system -std=c++11
test.cpp:6:13: error: invalid range expression of type 'sf::VertexArray'; no
      viable 'begin' function available
        for(auto& b:a)
                   ^~
1 error generated.

SergeyKagen

3 / 4 / 2

Регистрация: 02.04.2018

Сообщений: 315

1

19.04.2019, 22:16. Показов 131576. Ответов 14

Метки нет (Все метки)


Простой код, но Arduino IDE напрочь отказывается принимать переменные. Что за глюк или я что-то неправильно делаю?

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
void setup() {
  
  Serial.begin(9600);
  int count = 0;
  pinMode(7, INPUT);
  pinMode(13, OUTPUT);
 
}
 
void loop() {
 
  if( digitalRead(7) == HIGH ){ 
    
    while(1){ 
      delayMicroseconds(2); 
      count++;  
      if( digitalRead(7) == LOW ){ Serial.println(count); count = 0; break; }
      }
    }  
}

ошибка при компиляции «‘count’ was not declared in this scope», что не так?

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



marat_miaki

495 / 389 / 186

Регистрация: 08.04.2013

Сообщений: 1,688

19.04.2019, 23:26

2

Лучший ответ Сообщение было отмечено SergeyKagen как решение

Решение

C++
1
2
3
4
5
6
7
8
  int count = 0; //глобальная переменная
 
  void setup() {
   Serial.begin(9600);
  pinMode(7, INPUT);
  pinMode(13, OUTPUT);
 
}



1



Lavad

0 / 0 / 0

Регистрация: 03.10.2015

Сообщений: 25

14.09.2019, 22:33

3

Доброго времени суток!
У меня то же сообщение, но на функцию :-(
Создал функцию (за пределами setup и loop), которая только принимает вызов, ничего не возвращает:

C++
1
2
3
4
5
void myDispay(byte x, byte y, char str) {
  lcd.setCursor(x, y);
  lcd.print(temp, 1);   // выводим данные, с точностью до 1 знака после запятой
  lcd.print(str);   // выводим писанину
  }

В loop() делаю вызов:

C++
1
myDisplay(0,0,"C");

При компиляции выделяется этот вызов, с сообщением:

‘myDisplay’ was not declared in this scope

Замучился искать инфу о декларации/обьявлении функции. Везде, что находил, понимал одно: если ты вызываешь функцию, это и есть обьявление функции
Что делаю не так? В чем моя ошибка? Помогите, пожалуйста.

P.S. Код, что использовал в качестве функции, работоспособен. Раньше находился в loop(). Скетч постепенно разрастается, много однотипных обращений к дисплею…



0



Эксперт С++

8385 / 6147 / 615

Регистрация: 10.12.2010

Сообщений: 28,683

Записей в блоге: 30

14.09.2019, 23:57

4

Цитата
Сообщение от Lavad
Посмотреть сообщение

Создал функцию (за пределами setup и loop),

Перевидите на нормальный язык.
Какие еще пределы?

В другом файле что ли?

Добавлено через 1 минуту

Цитата
Сообщение от Lavad
Посмотреть сообщение

Замучился искать инфу о декларации/обьявлении функции. Везде, что находил, понимал одно: если ты вызываешь функцию, это и есть обьявление функции
Что делаю не так? В чем моя ошибка? Помогите, пожалуйста

Читать учебники по С++ не пробовали?

https://metanit.com/cpp/tutorial/3.1.php
http://cppstudio.com/post/5291/

Специфика Arduino лишь отличается тем что пред объявления не всегда нужны.

Добавлено через 7 минут
Кроме того иногда потеряй скобок {} приводят к таким ошибкам.



0



ValeryS

Модератор

Эксперт по электронике

8759 / 6549 / 887

Регистрация: 14.02.2011

Сообщений: 22,972

15.09.2019, 00:09

5

Цитата
Сообщение от Lavad
Посмотреть сообщение

Везде, что находил, понимал одно: если ты вызываешь функцию, это и есть обьявление функции

это где ж такое написано?
функцию нужно объявить перед первым вызовом, сиречь сверху
можно и просто декларировать сверху

C++
1
void myDispay(byte x, byte y, char str);

а объявить уже в удобном месте



0



0 / 0 / 0

Регистрация: 03.10.2015

Сообщений: 25

15.09.2019, 00:48

6

Неделю назад ВПЕРВЫЕ включил Arduino Uno.
Задолго до этого писал программы под Windows (БейсикВизуал) и AVR (Basic, немного Assembler). Т.е. имеется некоторое представление об объявлении переменных, функций,… От Си всегда держался как можно дальше. Это первая и последняя причина «нечитания» книг по Си. За неделю экспериментов на Arduino мнение об этом пока не изменилось — легче вернуться к Ассму, чем копаться в Си.

Написал на том же языке, что и читал на всяких форумах и справочниках по Arduino :-). За пределами этих функций — значит не внутри них.

Обе приведенных Вами ссылок просмотрел, проверил в скетче… В итоге вылезла другая ошибка:
function ‘void myDisplay(byte, byte, char)’ is initialized like a variable

void myDisplay(byte x, byte y, char str) тоже пробовал. Та же ошибка.

Что не так на этот раз? :-(



0



Модератор

Эксперт по электронике

8759 / 6549 / 887

Регистрация: 14.02.2011

Сообщений: 22,972

15.09.2019, 01:26

7

Цитата
Сообщение от Lavad
Посмотреть сообщение

В итоге вылезла другая ошибка:
function ‘void myDisplay(byte, byte, char)’ is initialized like a variable

точку с запятой в конце поставил?



1



Lavad

0 / 0 / 0

Регистрация: 03.10.2015

Сообщений: 25

15.09.2019, 08:46

8

Вот скетч. Проще некуда.

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
#include <PCD8544.h>
 
float temp = 0;
static PCD8544 lcd;   // даем имя подключенному дисплею (lcd)
static const byte Lm35Pin = 14;   // аналоговый пин (A0) Arduino, к которому подключен LM35
 
//void myDisplay() = 0;
//void myDisplay(byte, byte, char, float) = 0;
//void myDisplay(byte x, byte y, char str, float temp) = 0;
 
void myDispay(byte x, byte y, char str, float temp) {
  lcd.setCursor(x, y);   // начиная с (x,y)...
  lcd.print(temp, 1);   // выводим temp
  lcd.print(str);   // выводим писанину
}
 
void setup() {
  lcd.begin(84, 48);   // инициализируем дисплей
  analogReference(INTERNAL);   // подключаем внутренний ИОН на 1.1V
}
 
void loop() {
  float temp = analogRead(Lm35Pin) / 9.31;  // подсчитываем температуру (в Цельсиях)...
  myDisplay(0, 0, "C", temp);   // отправляем данные на экран
  delay(500);   // ждем 500 мсек
}

Любое из трех так называемых «объявлений» (строки 7…9) выдает одну и ту же ошибку — я пытаюсь объявить функцию как переменную.

Добавлено через 9 минут
Попробовал так:

C++
1
void myDisplay(byte x, byte y, char str, float temp);

Компилятор задумался (я успел обрадоваться), но, зараза :-), он снова поставил свой автограф :-)

undefined reference to `myDisplay(unsigned char, unsigned char, char, float)

На этот раз он пожаловался на строку вызова функции.

Добавлено через 34 минуты
Когда что-то новое затягивает, забываешь о нормальном отдыхе, теряешь концентрацию…
Нашел ошибку. Чистейшая грамматика

C++
1
void myDispay(byte x,...

Dispay вместо Display

Добавлено через 8 минут
ValeryS, благодарю за попытку помощи!



0



ValeryS

Модератор

Эксперт по электронике

8759 / 6549 / 887

Регистрация: 14.02.2011

Сообщений: 22,972

15.09.2019, 10:36

9

Цитата
Сообщение от Lavad
Посмотреть сообщение

void myDisplay(byte, byte, char, float) = 0;

вот так не надо делать(приравнивать функцию к нулю)
так в классическом С++ объявляют чисто виртуальные функции, и класс в котором объявлена чисто виртуальная функция становится абстрактным. Означает что у функции нет реализации и в дочернем классе нужно обязательно реализовать функцию. А из абстрактного класса нельзя создать объект

Добавлено через 5 минут

Цитата
Сообщение от Lavad
Посмотреть сообщение

void myDispay(byte x, byte y, char str, float temp)

Цитата
Сообщение от Lavad
Посмотреть сообщение

myDisplay(0, 0, «C», temp);

просишь чтобы функция принимала символ char str, а передаешь строку "C"
или передавай символ

C++
1
myDisplay(0, 0, 'C', temp);

или проси передавать строку, например так

C++
1
void myDispay(byte x, byte y, char * str, float temp);



1



Avazart

Эксперт С++

8385 / 6147 / 615

Регистрация: 10.12.2010

Сообщений: 28,683

Записей в блоге: 30

15.09.2019, 12:02

10

Кроме того наверное лучше так:

C++
1
2
3
4
5
6
7
8
void myDispay(PCD8544& lcd,byte x, byte y, char str, float temp) 
{
  lcd.setCursor(x, y);   // начиная с (x,y)...
  lcd.print(temp, 1);   // выводим temp
  lcd.print(str);   // выводим писанину
}
 
myDisplay(lcd,0, 0, 'C', temp);

Тогда можно будет вынести ф-цию в отдельный файл/модуль.



1



locm

15.09.2019, 21:07

Не по теме:

Цитата
Сообщение от Lavad
Посмотреть сообщение

Arduino Uno.

Цитата
Сообщение от Lavad
Посмотреть сообщение

AVR (Basic, немного Assembler).

Arduino Uno это AVR, для которого можете писать на бейсике или ассемблере.



0



Avazart

15.09.2019, 21:21

Не по теме:

Цитата
Сообщение от locm
Посмотреть сообщение

Arduino Uno это AVR, для которого можете писать на бейсике или ассемблере.

Но лучше не надо …



0



Lavad

0 / 0 / 0

Регистрация: 03.10.2015

Сообщений: 25

16.09.2019, 12:12

13

Цитата
Сообщение от ValeryS
Посмотреть сообщение

это где ж такое написано?
функцию нужно объявить перед первым вызовом, сиречь сверху
можно и просто декларировать сверху
а объявить уже в удобном месте

Оказалось, что я верно понял чтиво по справочникам: если ты вызываешь функцию, это и есть обьявление функции. А сама функция может располагаться по скетчу в ЛЮБОМ месте (но за пределами setup, loop и любых других функций). И больше никаких специфических строк.

Цитата
Сообщение от ValeryS
Посмотреть сообщение

вот так не надо делать(приравнивать функцию к нулю)…

Методом проб и ошибок уже понял :-).

Цитата
Сообщение от ValeryS
Посмотреть сообщение

или передавай символ… 'C'

Если передаю в одинарных кавычках

более одного

символа, а функция ждет как char str, то выводятся на экран только самый правый из отправленных символов. Отправил «абв», а выводится «в».
Выкрутился, прописав в функции char str[], а символы отправляю через двойные кавычки.

Цитата
Сообщение от ValeryS
Посмотреть сообщение

или проси передавать строку, например так… char * str

Буквально вчера попалось это в справочнике, но как-то не дошло, что тоже мой вариант :-).

Цитата
Сообщение от Avazart
Посмотреть сообщение

Кроме того наверное лучше так:

C++
1
void myDispay(PCD8544& lcd,byte x, byte y, char str, float temp) {...}

Тогда можно будет вынести ф-цию в отдельный файл/модуль.

Благодарю за совет! Как-нибудь проверю…



0



Эксперт С++

8385 / 6147 / 615

Регистрация: 10.12.2010

Сообщений: 28,683

Записей в блоге: 30

16.09.2019, 12:54

14

Цитата
Сообщение от Lavad
Посмотреть сообщение

Оказалось, что я верно понял чтиво по справочникам: если ты вызываешь функцию, это и есть обьявление функции

Нафиг выкиньте эти справочники.
Почитайте мои ссылки.



0



0 / 0 / 0

Регистрация: 03.10.2015

Сообщений: 25

16.09.2019, 13:00

15

Ссылки Ваши добавлены в закладки. Время от времени заглядываю.
Но теория для меня — всего лишь набор понятий. Я же высказался после практической проверки. А как я понял, так оно и работает :-)



0



Понравилась статья? Поделить с друзьями:
  • Error assets api is not available мортал комбат мобайл
  • Error battery cannot charge
  • Error assert was not declared in this scope
  • Error assembling war webxml attribute is required or pre existing web inf web xml
  • Error assembling jar