the craziest damn error i've ever seen! help!

This is a discussion on the craziest damn error i've ever seen! help! within the C++ Programming forums, part of the General Programming Boards category; its about saving again. i have it totally complete except for two things. they are very hard to explain. its ...

  1. #1
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    the craziest damn error i've ever seen! help!

    its about saving again. i have it totally complete except for two things. they are very hard to explain. its a windows error box that pops up, there are no compile errors. so the windows box pops up and says "dungeonofdoom.exe has encountered an error. sorry for any inconvenience.....". THen there is an option that says debug. I click that and then VC++6 pops up with my code in it, but in debug mode. then a box pops up and says "Unhandled exception in Dungeon of Doom.exe: 0xC0000005: Access Violation". I click ok and then you'll see the two pics that i attached, they are a pic of the screen in debug mode. please someone help me.
    Attached Files Attached Files

  2. #2
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    perhaps its this:

    Code:
    do
    			{
    			    if(search_weapon->id==weapon1)
    				{
    				    stop=1;
    				}
    			    if(stop!=1)
    				{
    			        search_weapon++;
    				}
    				cout<<search_weapon->id<<flush;
    				_getch();
    			}while(stop==0);
    there is the code with the error. search_weapon is type 'pointer to WEAPON, or WEAPON*'. it is SUPPOSED to cycle through all the variables of type weapon. it starts at dagger (seach_weapon=&dagger) and dagger is of type WEAPON. I want it to cycle through all variables of type WEAPON. i printed out each value after doing search_weapon++, and i get these HUGE weird numbers. i think that's the problem. how would i search through all the variables of type WEAPON?

  3. #3
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    yes, ive confirmed it. i have a struct WEAPON. WEAPON dagger. WEAPON* seach_weapon=&dagger. dagger.id=1. WEAPON sword. sword.id=2. when i increment search_weapon i want it to go to the next variable of type WEAPON (sword). but it doesn't. how would i do this? i need to do it because i have to search all of those variables for a matching id. a linked list or something? i dont even know what that is. HELP PLEASE!

  4. #4
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    Did you try running it through the debugger?

  5. #5
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    it doesnt matter, and yes i did. but i've already concluded its just because its not cycline through the variables. i dont know where i got the idea of search_wepon++, but i need to be able to search through all the variables of type WEAPON in a loop, because it would be too horendous to check through ALL the variables, and less modular.

  6. #6
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    um can we see the code for search weapon then maybe we can help.

    i cant tell from what i see of any evident problem, whats being passed to the function? how is search_weapon declared?is WEAPON a class of struct?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Damn ATI!
    By AloneInTheDark in forum Tech Board
    Replies: 48
    Last Post: 02-16-2008, 09:34 PM
  2. linked list and damn on linked list
    By St0rM-MaN in forum C Programming
    Replies: 13
    Last Post: 07-03-2007, 05:08 PM
  3. What makes WoW so damn addictive?
    By cboard_member in forum A Brief History of Cprogramming.com
    Replies: 91
    Last Post: 06-29-2006, 12:38 AM
  4. Damn!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 12-04-2001, 11:32 PM
  5. Damn Management!
    By Govtcheez in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 09-06-2001, 05:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21