tristan-oa / Adding-Tuples-to-the-C-Programming-Language

Adding functionality to array operations and introducing tuple representations to the C programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding Functionality to Array Operations and Introducing Tuple Representations in C

This project was my first university programming assignment. This made part of the CPS1011: Programming Principles in C course, forming part of my B.Sc. in Computer Science.

Task Breakdown

In this project, the following tasks were performed:

  1. Array Operations:

    • Cloning functionality was made possible for 3D integer arrays having any size.

    • Reversing functionality was implemented to reverse the order of words in a given array of strings. Eg:

        {"This is the first sentence", "and this is the second"}
        becomes
        {"sentence first the is This", "second the is this and"}
      
  2. Tuple Operations:

    • Creation of new tuples, as identified by a string ID and a sequence of element type/value (In the case of an existing identfier, the new tuple replaces the existing one).

    • Tuple Retrieval of a tuple object pointer, given its ID.

    • Tuple ID Retrieval of an existing tuple object, given its pointer.

    • Display of a tuple's contents, given its pointer.

    • Deletion of tuple object, given its ID.

    • Comparison of 2 compatible tuple objects1, by performing in-order element comparison of their elements, and returning a:

      • +1 if the first non-equal element pair is larger for the first tuple.
      • -1 if the first non-equal element pair is smaller for the first tuple.
      • 0 if all elements are equal.

      1 Compatible tuples are those with the same element number and types, or where the element number/types of the first is a prefix of the second.

    • Joining of 2 tuples, given the 2 pointers of tuples to be joined and a new tuple ID.

    • Saving of all existing tuple objects to disk.

    • Loading of all tuple objects from a saved file.

Documentation

A report describing the design process and motivation behind this project can be found here.

A detailed technical documentation of the source code written can be found here.

About

Adding functionality to array operations and introducing tuple representations to the C programming language


Languages

Language:C 67.8%Language:Makefile 16.8%Language:CMake 15.4%