#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
#include "NEW.H"
int main()
{
return 0;
}
and the *.cpp file:
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
#include "NEW.H"
void hangman::LooseLife()
{
cout << "testing"<<endl;
}
and now the header file....
#ifndef NEW_H
#define NEW_H
class hangman
{
public:
hangman()
{
lives = 1;
}
void LooseLife();
private:
int lives;
#endif
putting all that together should work but I get this error :
Compiling...
main.cpp
C:\Documents and Settings\John Rudd\Desktop\hangman\dynaic memory\main.cpp(15) : fatal error C1004: unexpected end of file found
hangman.cpp
C:\Documents and Settings\John Rudd\Desktop\hangman\dynaic memory\hangman.cpp(10) : error C2535: 'void __thiscall hangman::LooseLife(void)' : member function already defined or declared
c:\documents and settings\john rudd\desktop\hangman\dynaic memory\new.h(20) : see declaration of 'LooseLife'
C:\Documents and Settings\John Rudd\Desktop\hangman\dynaic memory\hangman.cpp(15) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
i cant tell whats wrong never done this before lol