diff --git a/LABA1.cpp b/LABA1.cpp index b8f0b2e..d11a2ef 100644 --- a/LABA1.cpp +++ b/LABA1.cpp @@ -1,14 +1,6 @@ #include #include -#include "histogram.cpp" -/* -Костыль!!!!! -#include "histogram.h" не работает, тем не менее, всё по методичке -работает только с #include "histogram.cpp" -разобраться!!!!!!!! - -Вынести печать в show_histogram_text(), а его в отдельный cpp и h -*/ +#include "histogram.h" using namespace std; struct Input { diff --git a/histogram.cpp b/histogram.cpp index 4653a64..38ded28 100644 --- a/histogram.cpp +++ b/histogram.cpp @@ -1,5 +1,4 @@ #include "histogram.h" - using namespace std; void FindMinMax(const vector& marks, double& min, double& max) { @@ -15,7 +14,7 @@ void FindMinMax(const vector& marks, double& min, double& max) { } }; -vector MakeHistogram(const vector& marks, int NCharts) { +static vector MakeHistogram(const vector& marks, int NCharts) { double interval = 0, i = 0, min = 0, max = 0; vector chart(NCharts); FindMinMax(marks, min, max); diff --git a/histogram.h b/histogram.h index 762c793..1199262 100644 --- a/histogram.h +++ b/histogram.h @@ -1,5 +1,6 @@ #ifndef HISTOGRAM_H_INCLUDED #define HISTOGRAM_H_INCLUDED +#include "histogram.cpp" //, . ! #include std::vector MakeHistogram(const std::vector& marks, int NCharts);