TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: JACK EVERETT
date: 1997-10-13 18:35:00
subject: NULL POINTER

OK, I am having a problem here I keep getting a Bad NULL pointer
assignment of some sort....
any Ideas or comments...I relize that there is no comments
I am real sorry about that but I removed them all (got flustered)
but anyway can any one help me..
I tried to upload this messaage  and it did not set the lines right so
please ignore that..
jack everett
// For creating monsters for SLAYER
#include 
#include 
#include 
#define NUM 3
struct monsterlst {
char monstername[80];
int hp;
};
int nummon;
int i;
char getmon[40];
FILE * monster;
struct monsterlst monsters[NUM];
main()
{
clrscr();
if (nummon == NUM)
{printf("\nMonster List is full\n");
}
fflush(stdin);
printf("\nWhat is the name of the monster: ");
gets(monsters[NUM].monstername);
printf("\nWhat is %s's HitPoints: ", monsters[NUM].monstername);
scanf(" %d",monsters[NUM].hp);
monster = fopen("c:\tc\bin\monster.dat", "ar+");
if (!monster)
{printf("There was an Error");
fwrite(monsters[NUM].monstername, sizeof(monsters[NUM].monstername), 1
, monster); fwrite(&monsters[NUM].hp, sizeof(monsters[NUM].hp), 1,
monster);
}
return 0;
}
--- ViaMAIL!/WC4 v1.30 
---------------
* Origin: A Mind's Eye View (FidoNet) 210-533-8643 (1:387/533)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.