 |
Server Help Community forums for Subgame, ASSS, and bots
|
| Author |
Message |
Versetti Novice

Gender: Joined: Jan 05 2004 Posts: 54 Offline
|
Posted: Sat Feb 28, 2004 11:07 pm Post subject: Access Violation in a linked list |
 |
|
|
|
I'm trying to make a addon for my biller and when the biller tries to add data in my linked lists it will say "Unhandled exception in SSGBiller.exe 0xC0000005: Access Violation."
Would anyone know how to fix this if you need to see anything else just ask and I'll show you some of that code you might need to help e out with this problem. |
|
| Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sat Feb 28, 2004 11:54 pm Post subject: |
 |
|
|
|
Lol show the code. Access violation is probably the most generic C++ error you can ever get. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
| Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Sun Feb 29, 2004 1:28 am Post subject: |
 |
|
|
|
Access violation is usually attempting to read/write NULL ptr, uninitialized ptr (ie garbage). As cyan said, post your code. _________________ 4,691 irradiated haggis! |
|
| Back to top |
|
 |
Versetti Novice

Gender: Joined: Jan 05 2004 Posts: 54 Offline
|
Posted: Sun Feb 29, 2004 11:06 am Post subject: |
 |
|
|
|
Here is the liked lists I made for it:
class EntryBoardUser{
public:
EntryBoardUser();
~EntryBoardUser();
int UserID; //Never Gets Replaced
char Name[32]; //Replace1 -- 1
char Email[100]; //Replace1 -- 2
char Sig[256]; //Replace1 -- 3
char title[32]; //Replace1 -- 4
int posts; //Replace2 -- 1
int warnlevel; //Replace2 -- 2
int Level; //Replace2 -- 3
bool banned; //Replace2 -- 4 -- (1 = False) (0 = True)
bool limitread; //Replace2 -- 5 -- (1 = False) (0 = True)
///put the stuff here
};
class BoardUser{
public:
BoardUser();
~BoardUser();
EntryBoardUser* item;
BoardUser* next;
BoardUser* prev;
//the node is here
};
class ControlBoardUser{
public:
ControlBoardUser();
~ControlBoardUser();
BoardUser* head;
BoardUser* tail;
void clear();
void remove(char *);
bool Replace1(int ,char *,char *);
bool Replace2(int ,char *,int );
}; |
then my append function is the first thing that gets the error:
void append(int ID,char *Name,char *Email,bool limit = false,int oplevel = 5,char *title2 = "Newbie"){
ControlBoardUser *parse;
if(parse->head && parse->tail){
parse->head=parse->tail=new BoardUser;
parse->head->item->UserID = ID;
memcpy(parse->head->item->Name,Name,32);
memcpy(parse->head->item->Email,Email,100);
memcpy(parse->head->item->Sig,0,0);
strncpy(parse->head->item->title,title2,32);
parse->head->item->posts = 0;
parse->head->item->warnlevel = 0;
parse->head->item->Level = oplevel;
parse->head->item->banned = false;
parse->head->item->limitread = limit;
UserID2++;
}
if(parse->tail){
BoardUser *parse2 = new BoardUser;
parse2->item->UserID = ID;
memcpy(parse2->item->Name,Name,32);
memcpy(parse2->item->Email,Email,100);
memcpy(parse2->item->Sig,0,0);
strncpy(parse2->item->title,title2,32);
parse2->item->posts = 0;
parse2->item->warnlevel = 0;
parse2->item->Level = oplevel;
parse2->item->banned = false;
parse2->item->limitread = limit;
UserID2++;
BoardUser *oldtail = parse->tail;
parse->tail = parse2;
parse2->prev = oldtail;
oldtail->next = parse2;
}
} |
and the error is when I ever try to write to the linked list it will cause that error can you help? |
|
| Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 40 page(s) served in previous 5 minutes.
|