Header File:
Code:
#ifndef __Assign5__h
#define __Assign5__h
#include <iostream.h>
#include <iomanip.h>
class cSTRING
{
public:
//Members Variables
char* cStr;
int nLen;
//Constructors
cSTRING(char cStr = '\0', int nLen=0);
cSTRING(char* cStr);
//Destructor
~cSTRING();
//Prototypes
int SetStringLength(char*);
char* SetStringCopy(char*,char*);
//Inspectors
const int GetStringLength( cSTRING& str );
const char* GetString();
//Methods
void Display (cSTRING& str);
}
#endif
CPP FILE:
Code:
#include <iostream.h>
#include "Assign5.h"
void main (void)
{
cSTRING str;
int nStrLen;
char str[50];
cout << "Enter a String: ";
cin >> str;
}
i am getting these errors:
error C2143: syntax error : missing ';' before 'PCH creation point'
error C2040: 'str' : 'class cSTRING' differs in levels of indirection from 'char [50]'