Welp, I've confirmed what I said above. I'm back in business until further notice!
Type: Posts; User: ljgerr93
Welp, I've confirmed what I said above. I'm back in business until further notice!
Oh, and here's what the input file looks like:
5
Llewellyn Mark
1 15 19 26 33 46
Young Brian
17 19 33 34 46 47
Cazalas Jonathan
1 4 9 16 25 36
Siu Max
Even after fixing it or removing the code, the program STILL crashes. The only thing I didn't try doing is freeing up memory for the array of structs, but A. that will be done in another test file I...
typedef struct
{
char firstname[20];
char lastname[20];
int numbers[6];
} KBLottoPlayer;
I also tried to declare without typedef (struct KBLottoPlayer), and it still crashes.
I've broken down the huge program I was recently assigned into several parts, and this is the first. I'm trying to read in data from an input file and store each piece into structs in an array. Here...
Yeah, I hear you. Well, FILE *ofp is definitely declared to write a file, and I don't have anything that would tell it to close the file until the very end of the program in main(). The .txt file is...
I can't use anything not mentioned in class, as convenient as it would be. And there's nothing wrong with the data (I used printfs to test, and it works perfectly); it's how I'm telling the program...
Even if I declare FILE *ofp in printGuestList, it still doesn't work. Besides, I had that format for the FILE *ifp that scanned in the values from the sample input file (in other words, FILE *ifp was...
I do that in the main function, before printGuestList is called.
Okay, sorry to bump this back to life, but there's one more issue. (This should be very easy to fix for those that have used it before.) So the final function is supposed to write a file with the...
Never mind! I found it, and the program works perfectly.
Here is what I want to do all together:
1. From the list of everything I read in from the input file, I want to first sort the list by priority from least to greatest (in this case, 1 is more...
Oh, and by the way, it's not really bubble sorting. It's an attempt at insertion sorting.
Actually, I did some experimentation with my list and got it to print all the names alphabetically. However, now comes the challenge of implementing the priorities and printing out a target output....
Just for reference, here's the output file I get:
ESPINOSA, DOUG 3
JAMES, ELIZABETH 2
JOHNSON, BEN 4
JOHNSON, JACKSON 1
MCFLY, MARTY 4
MOUSE, MICKEY 2
TELLINGER, SARAH 5
THOMPSON, GRANT 5
Oh, and I might ask for help with writing a file later, but this comes first.
So my newest program involves making a guest list of people in alphabetical order based on a certain priority. (The priority part I can figure out later; for now, I just need the program to print the...
Never mind; I fixed it on my own!
That too.
All right, it works now! Thanks for the tip, MK27!
Hmm...you know, that's a good point. A loop that checks to see if an event is filled or not. If the spot in the array is still 0, which means free, then the spots for the times will be set to 1. If...
Thing is, I use a for loop like that to fill in the spots. I kind of see how I might use another loop with if statements to see if there are conflicts or not, but the picture doesn't come to mind.
...
I'm working on two programs that both involve scheduling. The program reads in a data file, calculates some times (all in military), and fills in the appropriate spots with a 1. It then checks to see...
...I could've sworn I put those in there. Well, it works now. Thanks for the good eyes!
So at the moment, I am working with file I/O and data files. I'm working on a program that can select different days, months, and temperatures ranging from the years 1995 to 2011. My first step in...