Integration of SQLite Database With Native Visual C++ Application

Here is the way to Integrate SQLite Database with Visual C++ or Visual studio for win32 console application. I hope you find this helpful!!!!
  • Create a new C++ Win32 Console application.
  • Unzip the DLL and DEF files.
  • Place .DEF file into project’s source folder.
  • Place sqlite3.dll  in a System32 Folder.

Integration of SQLite Source Code with DevC++ Project

About SQLite:

SQLite is an in-process library that implements a self-containedserverlesszero-configurationtransactional SQL database engine. The code for SQLite is in the public domain and is thus free for use for any purpose, commercial or private. SQLite is currently found in more applications than we can count, including several high-profile projects.

SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file. The database file format is cross-platform - you can freely copy a database between 32-bit and 64-bit systems or between big-endian and little-endian architectures. These features make SQLite a popular choice as anApplication File Format. Think of SQLite not as a replacement for Oracle but as a replacement for fopen()

Integration of SQLite Database With DevC++ IDE

About DevC++ IDE

                         Devc++ is powerfull IDE to develop native application of C and C++ on windows operating system. This IDE provides multiple options to developer to develop wide range of application with the help packages like 2d Graphics, 3d Graphics, Allegro, Audio, audio processing,C++ Libraries, Compression, Cryptography, Database, Documentation, File, GTK, GUI, Image Manipulation,Logging,Mathematics,MinGW,Networking,OpenGL,Pattern Recognition,Physics,POSIX,Scripting,SDL,String Manipulation,Text console, Threading, Utilities,Video,Web,wxWidgets and XML.

Reversal of single linked list

Algorithm for Reversal  node
  • Step 1: First check the head status, if head status is NULL then it is EMPTY LIST, so no need to perform any task.
  • Step 2: Take 3 pointers of type node called prev,current and next and set prev pointer  to NULL,current pointer head.

Update node in single linked list at any position

Algorithm for Update node
  • Step1: First check the head status, if head status is NULL then it is EMPTY LIST, so no need to perform any task.
  • Step2: If head status is other then NULL then,
      • Get node count value.
      • Get node position value to perform delete operation.
      • validate node position value, if valid position, then go for further process.

Delete node at any Position in Singly Linked List

Algorithm for Delete node
  • Step1: First check the head status, if head status is NULL then it is EMPTY LIST, so no need to perform any task.
  • Step2: If head status is other then NULL then,
      • Get node count value.
      • Get node position value to perform delete operation.
      • validate node position value, if valid position, then go for further process.

Insert node at any Position : Singly Linked List - Data Structure

Algorithm for Insert node
  • Step1: First check the head status, if head status is NULL then it is EMPTY LIST, so no need to perform any task.
  • Step2: If head status is other then NULL then,
        • Get node count value.
        • Get node position value to perform insert operation.
        • validate node position value, if valid position, then go for further process.

Traversal in Single Linked List

Algorithm for Traversal
  • Step 1: First check the head status, if head status is NULL then it is EMPTY LIST.
  • If head status is other then NULL then do...
    • Take a temporary head and assign current head value to th.
    • Design a loop to travel until tail is occur.
    • For every repetition retrieve data field of node and shift th to next link
    • Stop traversal when tail is occur.

Video for Traversal


Node Count in Single Linked List

Algorithm for Node Count

  • Step 1: First check the head status, if head status is NULL then return 0(Zero) i.e.Empty Linked list.
  • If head status is other then NULL then do...
    • Take a counter and assign value to 0(Zero).
    • Take a temporary head and assign current head value to th.
    • Design a loop to travel until tail is occur.
    • For every repetition increment counter value by 1 and shift th to next link.
    • Return counter value when loop is terminated.

Video for Node Count


Implementation of single linked list in c language(Add Node/Node Count/Traversal)

Structure of Single link list

  • In a single-linked list every element contains data and a link to the next element,it can be shown like this..


  • Below you can see whole singly-linked list internal representation..




Implementation of Single link list



  • inorder to implement single linked list first we need a structure of single linked list, witch need two fields i.e. data and next.
  • Create a global pointer variable called 'head' and set the value to NULL.
Ex:







Algorithms for Adding a New Node

  • Step 1: If head status is NULL then follow below procedure...
      • Create a new node and store address into head.
      • Read the node information and store in head->data.
      • Assign NULL value to head->next because it first node and tail node also.
  • Step 2:If head status is other then NULL then find tail position.
      • Take a temporary head(th) and assign current head value to th.i.e th=head.
      • Then travel to tails node position by shifting temporary head to next, i.e. th=th->next.
      • Stop traveling when th->next become NULL.
      • Add New node at th->next position.
      • shift temporary head to newly created node i.e. th=the->next.
      • Read node information and store in th->data.
      • Assign NULL value to th->next because it is tail node.