#include<iostream> using namespace std; class FlashDrive { public: FlashDrive();
ID: 3828861 • Letter: #
Question
#include<iostream>
using namespace std;
class FlashDrive
{
public:
FlashDrive();
FlashDrive(int capacity, int used, bool pluggedIn);
~FlashDrive();
void plugIn();
void pullOut();
void writeData(int amount);
void eraseData(int amount);
void formatDrive();
int getCapacity();
void setCapacity(int amount);
int getUsed();
void setUsed(int amount);
bool isPluggedIn();
FlashDrive operator+(FlashDrive& drive);
FlashDrive operator-(FlashDrive& drive);
bool operator<(FlashDrive& drive);
bool operator>(FlashDrive& drive);
friend ostream& operator<<(ostream& os, const FlashDrive& drive);
friend istream &operator>>(istream &input, FlashDrive &drive);
private:
int my_StorageCapacity;
int my_StorageUsed;
bool my_IsPluggedIn;
};
My code is having error
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
and
ProjectsConsoleApplication1DebugConsoleApplication1.exe : fatal error LNK1120: 1 unresolved externals
How can I fix this
Explanation / Answer
#include
#include
#include<iostream>
using namespace std;
class FlashDrive
{
public:
FlashDrive();
FlashDrive(int capacity, int used, bool pluggedIn);
~FlashDrive();
void plugIn();
void pullOut();
void writeData(int amount);
void eraseData(int amount);
void formatDrive();
int getCapacity();
void setCapacity(int amount);
int getUsed();
void setUsed(int amount);
bool isPluggedIn();
FlashDrive operator+(FlashDrive& drive);
FlashDrive operator-(FlashDrive& drive);
bool operator<(FlashDrive& drive);
bool operator>(FlashDrive& drive);
friend ostream& operator<<(ostream& os, const FlashDrive& drive);
friend istream &operator>>(istream &input, FlashDrive &drive);
private:
int my_StorageCapacity;
int my_StorageUsed;
bool my_IsPluggedIn;
};
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.