You shall show the statement where the error occured. The code you presented has nothing common with the error. I think somewhere else in your program ItemType has another declaration maybe with using typedef.
#include <iomanip>
#include <iostream>
usingnamespace std;
#include <fstream>
# include <cstdlib>
using std::cerr;
using std::cout;
using std::endl;
using std:: ifstream;
#pragma once
class ItemType
{// ERROR here error C2371: 'ItemType' : redefinition; different basic types public:
ItemType();
//Function: Constructor
bool readProduct(ifstream &readfile);
//Function: Reads one item at the time from a file and returns true if the pid=-1 esle returns false
void printProduct(ofstream &writefile);
//Function description- prints one product at a time to a file in order
int getPid();
//Function description- return the product ID for a product
int getMin();
//Function description- return the minimum inventory for a product
int getMax();
//Function description-return the maximum inventory for a product
int getcurrentInventory();
//Function description- return the current inventory for a product
booloperator >= (ItemType other) const;
//Function description- overload '>=' operator
booloperator > (ItemType other) const;
//Function description- overload '>' operator
~ItemType ();
//Function:Destructor to free the memory
private:
int pid; // product id
int min; // minimum inventory for product
int max; // maximum inventory for product
double cost; // wholesale cost of product
double retail; // retail cost of product
int currentInventory; // today’s inventory for product
};