Skip to content

UnnatiSabu/DBProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Drive Link for demo - https://drive.google.com/drive/folders/1AOl0Z3-zy4n41BBAdJyvKaNulKYRxqGl

This code defines a database utility program written in C. The program allows the user to create a new database, add fields to it, and perform operations such as adding, reading, or deleting records.

The program starts by including the necessary header files and declaring several functions and variables. The main() function calls several other functions in the following sequence:

  1. opendbfile() - Opens a new file with the user-specified database name and prompts the user for the name of the unique identifier field.

  2. printinitialwrites() - Prints some initial lines of code to the file.

  3. printstructdetails() - Prompts the user to enter the names and data types of additional fields in the database, then writes the corresponding C code to the file.

  4. printswitchcase() - Begins a while loop and prints a menu of options for the user to choose from.

  5. printcasecreate() - Writes code for adding a new record to the database, prompting the user for input and writing the data to a CSV file.

  6. printcaseread() - Writes code for reading an existing record from the database.

  7. printcasedelete() - Writes code for deleting a record from the database.

  8. printcaseexit() - Writes code to exit the program.

  9. closedbfile() - Closes the file.

  10. compileprogram() - Compiles the program using the system() function.

The program uses a struct called db_details to store the names and data types of the fields in the database. It also declares several variables to keep track of the number of fields, the file name, and a shortened version of the database name.

Overall, this program provides a basic framework for creating a database utility in C.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages