Im attempting to implement strcpy or strncpy and both are showing an error no matter which i use.
The error is only under strncpy and strcpy
Item.cpp:
#include "Item.h"
#include <iomanip>
#include <iostream>
#include <ctime>
#include <string>
using namespace std;
#include "Date.h"
#include "POS.h"
#include "PosIO.h"
namespace sict {
Item::Item(){
_name = '\0';
_price = 0;
_taxed ='0';
_quantity = '\0';
}
Item::Item(const char* sku, const char * name, double price, bool taxed){
strNcpy(_sku, sku, MAX_SKU_LEN);
name = new char[20];
strcpy(_name, name);
_quantity = 0;
price = _price;
if (price = '\0') {
_taxed = true;
}
}
void Item::sku(const char* value){
strncpy(_sku, value);
}
void Item::price(double p){
p = _price;
}
void Item::name(const char * n){
strcpy(_name, n);
}
}
Any idea how to fix it, ive excluded alot of code from item.cpp thats irrelevant.