473,805 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Undeclared Identifier, Only found solutions, not reasons

1 New Member
Hey everyone, i've been browsing for a fix to my problem
1>c:\documents and settings\user\d esktop\judis_re pack\judis repack\judis repack\maplesto ryserver\invent ory.cpp(386) : error C2065: 'amount' : undeclared identifier
I've found some solutions but I'm not sure how they pertain to my problem. If possible, would there be any general methods of resolving such undeclared identifier problems? This is the string, I'm a complete beginner so i'm really bad a this. Thanks


void Inventory::take Item(Player* player, int item, int howmany){
for(int i=0; i<player->inv->getItemNum() ; i++)
if(player->inv->getItem(i)->id == item){
if(player->inv->getItem(i)->amount>=howman y){
Item* item = player->inv->getItem(i);
item->amount-=howmany;
howmany=0;
if (ISSTAR(item->id)) amount = item->amount;
if(item->amount == 0){
InventoryPacket ::moveItem(play er, item->inv, item->pos, 0);
player->inv->deleteItem(i );
}
else
InventoryPacket ::moveItemS(pla yer, item->inv, item->pos, item->amount);
break;
}
else{
Item* item = player->inv->getItem(i);
howmany-=item->amount;
item->amount=0;
InventoryPacket ::moveItem(play er, item->inv, item->pos, 0);
player->inv->deleteItem(i );
}
}
}
Apr 20 '09 #1
1 2595
Savage
1,764 Recognized Expert Top Contributor
@LuxCkrown
Is amount member of the Inventory class?

PS:Please use code tags (# button)
Apr 20 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4841
by: Saurabh Aggrawal | last post by:
Hi, if (iter->m_name.compare(pstrName) == 0) { // Provide our object. *ppunkItem = iter->m_pUnknown; // Addref our object... iter->m_pUnknown->AddRef(); break; }
9
16222
by: W. Van Hooste | last post by:
Just starting with C, can somebody explain why this does not work or point me in the right direction? I wrote some tools and did some coding but cant seem to get this one. I DID declare my FILE *fp! and still get... isource2.c: In function `getval': isource2.c:5: `FILE' undeclared (first use in this function) Here is my Example project:
5
4140
by: Marc Gustafson | last post by:
This function is executed when a application file is double-clicked to open in a VC++ application. Specifically, this function is enabled by RegisterShellFileTypes () in the application's InitInstance. However, under MFC 7.1 for VC++ .NET 2003, CFrameWnd::OnDDEExecute has a bug that repeatedly generates this error message in the debugger Error: failed to execute DDE command ''.
0
1496
by: Stephanie Doherty | last post by:
Hello World, I am trying to use a _spawnl function like this (and I have included the process.h file): _spawnl(_P_WAIT,iporgfile,iporgfile,NULL); It compiles with the following errors: error C2065: '_P_WAIT' : undeclared identifier
4
3671
by: Ian Harding | last post by:
I am investigating the upgrade of a VC++ 6 project to build in VS 2005. There is a compiler error in one of the MFC files - afxcomctl32.inl. The message is: error C2065: 'afxComCtlWrapper' : undeclared identifier. The odd thing is that if I hover over afxComCtlWrapper in the source code, the intellisense shows that it is declared and right-click "Go to Declaration" takes me to line 25 of afxwin.h which contains #define...
7
32393
by: michigaki | last post by:
hello, we are having problems in compiling a 'slightly' altered x264. We are always receiving a 'helloWorld' undeclared (first use this function) error. We may be commiting a very simple error but we just have to ask after looking through possible solutions that have not worked. So far, we are able to successfully compile the x263 source (an unaltered one from the VideoLAN downloads section) using the instructions found at...
2
19874
by: aarthi28 | last post by:
Hi, I have this code that I am trying to compile, but I am getting the following errors 'CoInitializeSecurity': identifier not found 'EOAC_NONE' : undeclared identifier I have pasted the code below // Using_WMI1.cpp : Defines the entry point for the console
5
12542
by: vmagana | last post by:
First of all I would like to indicate that I am a newbie a programming. I am having a problem compiling a sample source code that I downloaded from microsoft. When I try to build the program I get an error that 'STORAGE_PROPERTY_QUERY' undeclared identifier. This structure is defined in the ntddstor.h file and is included. I dont understand why it does not see this structure. OS: Windows XP, Visual C++ 6.0, latest SDK and changed the...
3
3296
by: Anna Smidt | last post by:
Thanks for the help so far. I have some problems left. One of them is an undeclared identifier, but it's unclear to me why the compiler fights with me. It says "iter: undeclared identifier" I thought that the identifier was clear: "int", or is int just the declaration, and the identifier is something else? Thanks a lot.
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10613
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.