Bobik4556Ttft
@Bobik4556Ttft
Тот ещё Мухтар

Как обратиться к статическому полю класса внутри класса?

выражение должно иметь тип класса, но имеет тип "std::vector<int, std::allocator<int>> (*)(int lng, int wdth)"C/C++(153)

#include <vector>
class SqInRect
{
  public:
  int length;
  int width;
  int square_figure;

  static std::vector<int> sqInRect(int lng, int wdth);
  SqInRect(){
    length = sqInRect.size();//Здесь
    width = sqInRect.at(0);//Здесь
    square_figure = length * width;
  }
  void Square(int square_figure, int increment_figure){
    if(square_figure % increment_figure * increment_figure >= increment_figure * increment_figure){
      square_figure -= increment_figure * increment_figure;
      sqInRect.push_back(increment_figure);//и здесь подчеркивает.
    }else{
      increment_figure--;
    }
    if(square_figure != 0)
      Square(square_figure, increment_figure);   
  }
};
  • Вопрос задан
  • 117 просмотров
Решения вопроса 1
Adamos
@Adamos
Где поле? У тебя метод объявлен, с двумя аргументами.
Учебник все-таки стоит дочитывать.
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы