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.

Introduction To Single Linked List

Description 

  • In a single-linked list every element contains some data and a link to the next element(link), which allows to keep the structure.
  • In this type of Linked List two successive nodes are linked together in linear fashion.
  • Each element of the list is called a "node".
  • First node is called "head" and it's a dedicated node. By knowing it, we can access every other node in the list. 
  • Last node of the list is called "Tail",By knowing it we can perform add operation.
  • Each Node contain address of the next node to be followed.
  • In Single Linked List only Linear or Forward Sequential  movement(traversal) is possible.
  • Elements are accessed sequentially, no direct access is allowed.

Structure of single linked list

  • Every node of a singly-linked list contains following information
    • A value (primitive data/user define data).
    • A link to the next element (pointer data).
  • Sketchy, it can be shown like this...







    Example 1:   primitive data type single lined list
                                 struct single_link_list
                                   {

                                            int data;

                                            struct slink*next;

                                    };

    Example 2:   User define data type single lined list

                                  struct emp
                                    {
                                             int id;
                                             char name[36];
                                             int sal;
                                     };
                                     struct single_link_list
                                      {
                                            struct emp data;
                                            struct slink*next;
                                      };

    Single linked list Internal representation


    • In Singly-linked list implementation First node called head and no other node points to it. 
    • Link to the head is usually stored its data and information of next data structure(Next link). For empty list, head initial value is set to "NULL".
    • in Single linked list Last node called "Tail" usually stored its data and Next link data value is set to "NULL" because it is terminal node.
    • Below you can see another picture, which shows the whole singly-linked list internal representation..
      Operations on Single Linked List
      • Adding node
      • Inserting  node
      • node Count
      • Traversal
      • Deletion node
      • Updating node data 

      Difference Between Array and Linked List

      Array Vs Linked List

      • Array and linked list are having 4 main difference....
            1. Element Access
            2. Memory Structure
            3. Insertion / Deletion
            4. Memory Allocation

      Element Access

      • Stack elements can be randomly Accessed using Subscript e.g array[0],array[1] can be randomly accessed.
      • While In Linked List We have to Traverse Through the Linked List for Accessing Element. So O(n) Time required for Accessing Element.
      • Generally In linked List Elements are accessed Sequentially.
      Memory Structure
      • Stack is stored in contiguous Memory Locations.
      • Element is stored at any available Location , but the Pointer to that memory location is stored in Previous Node. 
      Insertion / Deletion
      • As the Array elements are stored in Consecutive memory Locations so insertion and deletion is allowed.
      • In Linked List we have to Just Change the Pointer address field ,So Insertion and Deletion Operations are quite easy to implement.
      Memory Allocation
      • Memory Should be allocated at Compile-Time in Stack.
      • In Linked list memory can be allocated at Run-Time.
      • Stack uses Static Memory Allocation.
      • Linked List Uses Dynamic Memory Allocation

      Cygwin installation on windows Operating system with NetBeans IDE integration

      Description

      • Cygwin is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.
      • A DLL (cygwin1.dll) which provides substantial POSIX API functionality.
      • The Cygwin DLL currently works with all recent, commercially released x86 32 bit and 64 bit versions of Windows, starting with Windows XP SP3.
      • This we are using this compiler we can Get that Linux feeling - on Windows.

      Linked List Introduction

      Introduction

      • In memory a linked list is a data structure that consists of a sequence of data records in a such way that each record there is a field that contains a pointer to the next record in the sequence.
      • Each record of a linked list is often called an element or node.
      • Each element of the list contains the address of the next node is usually called the next link or next pointer and remaining fields are known as data, or information, or value, or cargo,or payload fields.
      • The first node/element of the list is called 'Head' or Car and last node is called 'Tail' or CDR (pronounced could-er).
      • Linked list are classified into three types of linked list
            1. Single linked list
            2. Double Linked list
            3. Circular linked list
              1. Single Circular linked list
              2. Double Circular linked list

      Advantages of Linked List

      • Linked List is Dynamic data structure so they can grow and shrink during run time
      • On Linked list Insertion and Deletion Operations are Easier
      • Efficient Memory Utilization i.e no need to do any pre-allocation like Array.
      • Faster Access time,can be expanded in constant time without memory overhead in circular linked list.
      • Linear Data Structures such as Stack,Queue can be easily implemented using Linked list.  
      Disadvantages of Linked List
      • Extra memory is needed for storing the next link information using pointer. 
      • Array can be randomly accessed , while the Linked list cannot be accessed Randomly.
      • Individual nodes/elements are not stored in the contiguous (continues) memory Locations.

      Dev-C++ 5.6.3 installation Process on Windows 8 64/32 Bit operating System

      Description

      • Dev-C++ uses Mingw port of GCC (GNU Compiler Collection) as its compiler for Windows7 and Windows 8 Operating systems on 32\64bit version.
      • This Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the C/C++ programming language.
      • Dev C++ IDE creates native Win32 console and GUI application.

      Introduction To Data Structure and Types in C-Language

      • Data structure is a way of representation of relationship between logical related data elements.
      • In data structure, decision on the operations such as storage, retrieval and access must be carried out between the logically related data elements only.
      • Data Structure always describe about data representation in memory.

      Applications of Data Structure

      • Compiler Design
      • Operating System Design like Memory Management (Linked List + Hash-Map)
      • Database Management System(B-Tree)
      • File systems(Trees)
      • Statistical analysis package (Data mining algorithms)
      • Network data model(Graph)
      • Electronic circuit and simulation(Graphs)
      • Numerical Analysis,
      • Artificial Intelligence
      Types Of Data Structure
      1. Linear data structure

      2. Non-linear data structure

      • When Data Elements are arranged in sequential manner it is called Linear data structure. When we are working with  this type always a linear relationship is formatted between the elements with the help of sequential memory locations.
                                                         Ex:  Arrays, Stacks, Queues and Linked list.
      • In Non Linear Data structure data Elements are stored in hierarchical manner,  it forms the relation with the help of random memory locations.in this data structure in witch the elements are not arranged in a linear or sequential memory locations.
                                             Ex:  Tree, Graph, and Table.

      Installing Turbo C++ V3.0 on Windows 7/8 32bit Operating System with Maximized Window

      This is basic version c language IDE for beginners witch can be downloaded from my google drive.

      This compiler compactable to windows7 and windows8 32 bit OS only. 

      Installing Process

      • Download setup files from google drive and extract in local system.
      • Run SETUP.EXE
      • Select Next from welcome dialog box

      Loading/Saving C-Language programs from user specific path in Turbo-C++3.0.

      Generally Every C-Language Related Programs By Default Loaded From C:\TC\BIN Directory , so if we need to load from user specific path then follow this steps...
      • Create a new directory in local drive i.e. D or E or F. ( Ex:-  D:\CFILES )