#include #include "cylinder.h" int main(){ Cylinder cylinder1(10,10); std::cout << cylinder1.volume() << std::endl; return 0; }
#ifndef cylinder_h #define cylinder_h class Cylinder{ private: double radius; double height; public: Cylinder() = default; Cylinder(double r, double h); double volume(); }; #endif
#include "cylinder.h" Cylinder::Cylinder(double r, double h){ radius = r; height = h; } double Cylinder::volume(){ return 3.14*radius*radius*height; }
Quote:undefined reference to `WinMain' collect2.exe: error: ld returned 1 exit status
IDE
Windows GUI
Console
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)