BusFlow is a console-based Bus Ticket Reservation System built using the C programming language.
This is my first complete system-level project in C where I implemented real-world concepts like seat management, ticket generation, waiting list handling, cancellation, and file persistence.
✔ Search bus by:
- Source
- Destination
- Date
✔ Case-insensitive search
Two booking modes:
Seats are automatically assigned based on passenger priority:
| Category | Seat Range |
|---|---|
| Disabled | 1 – 2 |
| Emergency | 3 – 4 |
| Pregnant | 5 – 6 |
| Senior Citizen (60+) | 7 – 8 |
| Normal | 9+ |
- User selects seat manually
- System validates:
- Seat availability
- Seat priority eligibility
- Input correctness
- Automatically generates incremental Ticket IDs
- Stored in
ticketid.txt - Starts from 1000
- Persists between runs
The system saves data even after program closes.
Files used:
seats.dat→ Stores seat booking statustickets.txt→ Stores confirmed ticket recordsticketid.txt→ Stores last generated ticket ID
If seats are full:
- Passengers are moved to waiting list
On cancellation:
- Seats are reallocated based on priority
- Cancel using Ticket ID
- Frees allocated seats
- Automatically reassigns seat to waiting list passenger
- Structures (
struct Bus,struct Passenger) - Arrays
- Global variables
- File handling (
fopen,fread,fwrite,fprintf) - Binary file storage
- String manipulation
- Case-insensitive search
- Input validation
- Modular programming
- Priority-based logic design
BusFlow/
│
├── Module1.c # Main program file
├── seats.dat # Seat booking binary file
├── tickets.txt # Ticket records
├── ticketid.txt # Stores last ticket ID
└── README.md # Project documentation
gcc Module1.c -o BusFlow
./BusFlow
- Initialize buses
- Load saved seat data
- Display available buses
- Search bus
- Enter passenger details
- Choose seat mode (Auto / Manual)
- Generate temporary ticket
- Confirm booking
- Save ticket & seat data
- Allow cancellation if needed
Through this project, I learned:
- How real-world reservation systems work
- How to persist data using files
- How to design priority-based seat logic
- How to manage waiting lists
- How to handle user input safely
- How to modularize large C programs
- Multiple ticket lookup
- Admin dashboard
- Payment simulation
- Multiple bus management via file
- Database integration (MySQL)
- Better UI formatting
Built as part of my C programming learning journey.