//main.cpp
#include "drinksAtWork.h"
void main(void)
{
drinksAtWork Daw;
Daw.ChooseDrink();
//Xml();
}
//drinksatwork.h
#ifndef DRINKSATWORK_H
#define DRINKSATWORK_H
#include <stdlib.h>
class drinksAtWork
{
private:
char *ch;
public:
drinksAtWork();
void ChooseDrink();
~drinksAtWork();
};
#endif
//drinksatwork.cpp
#include "drinksAtWork.h"
/*#include <file.h>*/
#include <iostream.h>
//#include <fstream.h>
void drinksAtWork::ChooseDrink()
{
cout << ch << endl;
cout << "Choose your can." << endl;
/* FILE *fp;//write equivalent code using fstream*/
cin >> ch;
}
drinksAtWork::drinksAtWork()
{
ch=new char;
ch="ff";
}
drinksAtWork::~drinksAtWork()
{
delete ch;
}
at first compiled at linked but when data was entered at the command prompt I ran into an assertion error. I pasted the line of the location of the error in Edit-Breakpoints-Data (Tab)-Enter the expression to be evaluated with the not(!) sign in front of it but it would not be accepted to be evaluated. Now after having closed the compiler and reopened it at another time it has LINK : fatal error LNK1000: unknown error; consult documentation for technical support options. Someone help?