cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Circle.h is not working!
Circle.h is not working!
Apr 4, 2020 at 7:32pm UTC
rosesmith
(12)
SO this is not working. says that the #include"circle.h" can not be found!!
please help me.
#include <circle.h>
Circle::Circle()
{
this->radius = 0;
}
const float Circle::calcCircumference()
{
return 2 * pi * radius;
}
const float Circle::calcArea()
{
return pi * getRadius() * getRadius();
}
void Circle::setRadius(float radius)
{
this->radius = radius;
}
const float Circle::getRadius()
{
return radius;
}
const void Circle::showData()
{
std::cout << "Radius of circle is " << getRadius() << std::endl;
std::cout << "Circumference of circle is " << calcCircumference() << std::endl;
std::cout << "Area of circle is " << calcArea() << std::endl;
}
Apr 4, 2020 at 7:41pm UTC
Repeater
(3046)
Is there a file named "circle.h" ?
Apr 4, 2020 at 8:04pm UTC
Ganado
(6805)
Where is your (presumably "circle.cpp") file located?
Where is your "circle.h" file located?
Try changing to
#include "circle.h"
Documentation for GCC:
https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html
Documentation for Visual Studio:
https://docs.microsoft.com/en-us/cpp/preprocessor/hash-include-directive-c-cpp
Last edited on
Apr 4, 2020 at 8:10pm UTC
Topic archived. No new replies allowed.