ATM Management System using Function in C

Опубликовано: 14 Июнь 2026
на канале: Study Programming tricks & tips with ROHIT
3
0

Many beginners face a problem where a bank or ATM program in C shows updated balance, but the actual balance does not change. This happens because C uses pass by value by default.

When we pass a variable to a function, only a copy of that value is sent, not the original variable. So any deposit or withdrawal done inside the function affects only the copy, not the real balance. That’s why it feels like the program is taking “false money”.

To fix this, we use pointers and pass the address of the balance. This allows the function to modify the original value in memory, making the bank transaction work correctly.