CFanatic

Go Back   CFanatic > Programming > C++ Programming

Join CFanatic Forum Now

Lookover this code please topic posted under C++ Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 06-27-2007, 08:22 PM
Junior Member
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
minipwn is on a distinguished road
| More
Exclamation Lookover this code please

Code:
// This is the main DLL file.
#include <iostream>
#include "stdafx.h"
//Battle Sequence Start
#include "Seventh kingdom.h"
#define character Elf
#define HP 100
#define MP 50
#define spell 20
#define enemy 100
#define enemyHIT 20
#define attack 10
#define potion 1
#define heal HP
void character()
{
	cout << "Welcome\n" character;
}
int enemy()
{
	cout << "The Spider has " << enemy << "HP \n";
}
int attack()
{
	int z,a,s,r;
	cout << "Choose. attack or heal: " ;
		cin >> z;
		if (z=attack)
		cout << "\nyou hit enemy for " << attack '\n';
		cout << "enemy hits you for " << enemyHIT '\n';
		enemy-attack= a
			a = new (nothrow) int [a];
		cout << "the enemy now has " << enemy << "hp left\n";
		cout << "and you have " << HP << "hp left\n";
		else (z=heal)
			cout << "you heal for " << heal << "hp\n";
		    cout << "enemy hits you for " << enemyHIT << "hp";
			heal + hp - enemyHIT = s;
				s = new (nothrow) int [s];

return 0;
}

this is a test sequence for a battle

------ Build started: Project: Seventh kingdom, Configuration: Debug Win32 ------
Compiling...
Seventh kingdom.cpp
.\Seventh kingdom.cpp(17) : error C2065: 'cout' : undeclared identifier
.\Seventh kingdom.cpp(17) : error C2146: syntax error : missing ';' before identifier 'Elf'
.\Seventh kingdom.cpp(17) : warning C4551: function call missing argument list
.\Seventh kingdom.cpp(19) : warning C4091: '' : ignored on left of 'int' when no variable is declared
.\Seventh kingdom.cpp(19) : error C2143: syntax error : missing ';' before 'constant'
.\Seventh kingdom.cpp(19) : error C2059: syntax error : 'constant'
.\Seventh kingdom.cpp(20) : error C2143: syntax error : missing ';' before '{'
.\Seventh kingdom.cpp(20) : error C2447: '{' : missing function header (old-style formal list?)
.\Seventh kingdom.cpp(23) : warning C4091: '' : ignored on left of 'int' when no variable is declared
.\Seventh kingdom.cpp(23) : error C2143: syntax error : missing ';' before 'constant'
.\Seventh kingdom.cpp(23) : error C2059: syntax error : 'constant'
.\Seventh kingdom.cpp(24) : error C2143: syntax error : missing ';' before '{'
.\Seventh kingdom.cpp(24) : error C2447: '{' : missing function header (old-style formal list?)
Build log was saved at "file://c:\Documents and Settings\kyless\My Documents\Visual Studio 2005\Projects\Seventh kingdom\Seventh kingdom\Debug\BuildLog.htm"
Seventh kingdom - 10 error(s), 3 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Last edited by shabbir; 06-27-2007 at 10:47 PM. Reason: Code block
Reply With Quote
  #2  
Old 06-27-2007, 10:49 PM
shabbir's Avatar
Administrator
 
Join Date: Sep 2006
Posts: 1,163
Thanks: 57
Thanked 63 Times in 44 Posts
shabbir has a spectacular aura aboutshabbir has a spectacular aura about
| More
Re: Lookover this code please

To have the line #define character Elf you need to define the Elf as well. Do you have them in the .h files or what?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ code for Kruskal Algorithm ravi_forum C++ Programming 11 03-26-2012 01:58 AM
sample code about CryptoAPI 李一磊 Win32 Programming 3 03-19-2008 11:01 PM
Compile C code in Linux Tlhokomelo C Programming 5 11-23-2007 10:50 AM
C# Code ShahdaaD C# Programming 0 01-01-2007 04:47 AM
Help with code (parse error) BWIGLEY Game Development 1 11-29-2006 03:58 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 02:11 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board