Hello umairbilal,
In addition to what
dutch has said your above code does not compile and needs several fixes before it can compile and run.
In your includes you have "conio.h". Not everyone has this header file and:
salem c once wrote:
#include<conio.h>
Obsolete since 1990, when the world stopped using DOS as a primary operating system.
|
Next "string.h" is not the same as "string". You can use "string" and do away with "string.h". You will also need to change line 32
if(strcmp(pass,"manage")==0)
to
if (pass == "manage")
to use a "std::string".
Try to avoid using single letter variable names. It is very confusing and hard to follow in the code. A variable name should be a noun that describes what it is or does.
exit (0);
use sparingly. This is an unconditional exit from the program and not the best way to use it. When used in a switch you should leave the switch and go back to where it was called from.
As
dutch has said I would put all the menus in functions using "main" to direct the program. And when it comes time to exit the program you would return to main and exit properly.
"main" should be used to direct the program flow not be the program.
Going back to your global variables they are not needed and even moving them to "main" there are not needed there.
The functions that use these variables are where they should be defined because the functions are the only place where they are used.
Last thought "system(???)" should be avoided. This is not as secure as you might think and not everyone used Windows or can use this. If this is for personal use or school it works.
There are many parts of your program that can be improved, but first thing first.
Hope that helps,
Andy
P.S. Post the requirements of the program, if any, so everyone can tell if you are following the directions.