DEV Community

Discussion on: How to Create an ATM Machine Using Functions in C Language

Collapse
 
pauljlucas profile image
Paul J. Lucas

void menu(int *choice);

You really should just return the value:

int menu(void);

scanf("%d", &*choice);

If choice is a pointer, just write:

scanf("%d", choice);

You repeat the call to menu() in every case. You could more simply do:

while ( (choice = menu()) <= 5 ) {

Collapse
 
amberitas17 profile image
amberitas17

thank you for your advice!! as I said in my ending post, this was my final project in my introduction to c language in my college and needed to be improved. Although my professor is so strict at that because he discussed 1/4 of the Introduction to C language and it was merely a beginner's project... I appreciate the advice