This commit is contained in:
stmctommyau 2023-09-16 17:59:00 +08:00
parent c5018659d7
commit 565a61dd9b
No known key found for this signature in database
GPG Key ID: 87B1991E1277F054

12
utils.h
View File

@ -31,13 +31,17 @@ void fflush_stdin(){
#endif
}
char * welcome_message(FILE * fp){ //cross compatible
if(!fp){//if fp is NULL
char * welcome_message(void * ptr){ //cross compatible
if(!ptr){//if fp is NULL
return "><Welcome to the Student Union POS system><\n";
}
fprintf(fp,"><Welcome to the Student Union POS system><\n");//welcome messgae
if(feof(ptr)){// if ptr a string or file
sprintf(ptr,"><Welcome to the Student Union POS system><\n");//welcome message
}else{
fprintf(ptr,"><Welcome to the Student Union POS system><\n");//welcome message
}
}
int choices_selecter(char * Items[],int items,char * welcome_messages){
int choice = 0;
do{