I'm having issues utilising header file that I created. Object from the class defined in invoice
is not created in the main method.
Here's the contents of my header file that I made:
invoice.h
#pragma once
#include <string>
#include<iostream>
#include"stdafx.h";
using namespace std;
class Invoice
{
private:
string partno, description;
int quantity, price;
public:
Invoice(string partno, string description; int quantity, price);
//void partno(string);
//void description(string);
//void quantity(int);
//void price(int);
int getinvoiceamount();
string getPartno() {
return partno;
}
string getDescription(){
return description;
}
int getQuantity(){
return quantity;
}
int getPrice(){
return price;
}
void setPartno(int partno)
{
Invoice::partno=partno
}
void setDescription(int discripyion)
{
Invoice::description=description
}
void setQuantity(int quantity);
{
Invoice::quantity=quantity
}
void setPrice(int price);
{
Invoice::price=price
}
~Invoice();
};
Here's the contents of the file where I'm using my header file:
invoice.cpp
#include "stdafx.h"
#include "invoice.h"
#include "stdafx.h"
#include "Account.h"
#include<iostream>
#include<conio.h>
#include <string>
using namespace std;
int invoice::getinvoiceamount()
{
return (getquantity*getprice)
if (quantity != 0)
quantity = 0;
if (price != 0)
price = 0;
}
hardware::~hardware()
{
}
Just let me know where I'm doing wrong!