I need help with this program

This is a discussion on I need help with this program within the C Programming forums, part of the General Programming Boards category; This is a little practice program I wrote in my spare time:
Code:
#include<stdio.h>#include<stdlib.h>
#include<string.h>
#include<time.h>
struct work{
char fname[10][10];
...

It's supposed to be a small database...i'm in the process of learning structs so I decided to try and write a program incorporating it. Problem is that when I enter a number corresponding to an option that shows up on the screen, the program closes off and I can't figure out why it's doing it. The program compiles so I know it's a logic error and not a syntax for sure.

That's strange.
Because someone capable of mixing fgets() and scanf() successfully ought to have figured that bit out for themselves long ago.

Further, if you did actually write it, you must have had some idea of how accept() was going to be used, otherwise you would never have figured out it was supposed to return an int.
If you had the idea for accept, you would also have the idea of how to use it, and more importantly, where to use it.

I suggest you look again, this should come second nature to you.
Just giving you the answer won't help you long term.

I find it hard to understand how you had the wherewithal to write a program like the one above, yet don't understand what functions to call.

What seems more plausible to me is that you have been given a homework assignment, and want some help (i.e., you want someone else to do your work / you want the easiest possible way of making the grade).

Homework is for your benefit. If you want to actually understand and remember subject material, it takes practice; to that end, homework is assigned. Please, do yourself a favour, and try harder. You will be glad you did.

Well, you went to a lot of trouble to write all those other functions; perhaps you could consider calling them. You will have to actually pay attention to the input you receive (at the moment you just ignore it), and perhaps you could make a decision based on that input, which function to call.

It's not a HW assignment.
Reason I asked which should I call is that i've tried calling them but they don't seem to work...even if I allow file to be called in main and allow it to just print a simple statement it still doesn't work...only fupdate and menu works properly...

Before this program I wrote the solution to an actual problem and I used a function with it and it worked correctly:

I write functions all the time that I have no idea how to call. I design them very carefully, with a nice top-down design (sometimes combination of bottom-up and top-down) and then get lost and have no idea how they all fit together. *shrug*

I write functions all the time that I have no idea how to call. I design them very carefully, with a nice top-down design (sometimes combination of bottom-up and top-down) and then get lost and have no idea how they all fit together. *shrug*

Yeah, if your main() calls menu() followed by getchar(), and menu() only contains a single call of printf(), you would not expect any functions other than menu(), printf(), or getchar() to magically be called. That is what the first post in this thread involved.

If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.