A simple and efficient Bus Reservation System built using the C programming language. This project provides a console-based ticket booking experience where users can view buses, check seat availability, book tickets, and manage reservations.
- View available buses
- Check seat availability
- Book tickets
- Cancel ticket
- Store passenger information
- Easy file handling for saving data
- Simple and clean console UI
- Language: C
- Compiler: GCC / MinGW
- IDE (optional): VS Code / CodeBlocks / Dev-C++
-
Install any C compiler (GCC recommended).
-
Clone the repository:
git clone https://github.com/jahidhasanpiyesh/-Bus-Reservation-System.git
-
Open the project folder.
-
Compile the program:
gcc main.c -o bus
-
Run the program:
./bus
Bus-Reservation-System/
├─ main.c
├─ bus.h
├─ data.txt (for storing booking info)
└─ README.md
This project helps students practice:
- File handling in C
- Arrays & structures
- Functions and modular coding
- Input validation
- Basic system design
Here are the realistic and commonly expected errors that occur while building a Bus Reservation System in C:
The program stores booking information inside data.txt. If the file is missing, the program cannot load or save data.
- Fix: Create an empty
data.txtfile in the project folder.
When the program expects a number but the user enters text, it may crash.
- Fix: Validate numeric input and clear the buffer.
If the user enters an invalid seat number (too high or low), the program may behave incorrectly.
- Fix: Add range checks to ensure the seat number is valid.
Errors appear when functions are used without being declared, or header file is not included properly.
- Fix: Ensure all function prototypes are included in
bus.h.
Using "w" instead of "a" overwrites previous booking data.
- Fix: Use
"a"mode when adding new records.
Feel free to fork the repository and submit pull requests to improve features or fix bugs.
This project is licensed under the GNU General Public License v3.0.
- Commercial Use: You can use this software for commercial purposes.
- Modification: You can modify the code, but you must keep the source code open.
- Distribution: You can distribute the original or modified code.
- Credit: You must give credit to the original author (Md Jahid Hasan).
See the LICENSE file for more details.
- Developer: Md Jahid Hasan
- Email: jahidhasanpiyesh@gmail.com
- LinkedIn: Md Jahid Hasan
- Portfolio: My Portfolio