Skip to content

Highly optimized implementation of string in C with 48+ functions for manipulation.

Notifications You must be signed in to change notification settings

saksham-joshi/Modern-String

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

🔠 Modern String in C

  • This is a package which contains implementation of string in C language.
  • It provides several optimized functions written in C.
  • It is simple and easy to use.
  • It matches the speed and efficiency of 'std::string' from C++.
  • Takes only 24 bytes of memory in x64 architecture.

How to use it?

  • Step 1: Copy this whole repo to your project's directory.
  • Step 2: Include 'String.h' file in your code like this:
#include "Modern_String/Modern_String.h"
  • Step 3: To create a String, below is an example:
#include "Modern_String/Modern_String.h"

int main(void)
{
    ModernString str = makeString("Hello, World");

    printString(&str);

    destroyString(&str); // destruction is important

    return 0;
}

NOTE: Don't create instance of 'struct String' directly. Instead, call 'makeString()' functions which is as fast as creating an instance directly and it performs additional settings to make your string work stable.

🎹 Coding Convention

Functions - camelCase ending with word 'String'.
Function Parameters - smallcase starting with '__'

Local Variables - lowercase
Global Variables/constants - UPPER_CASE

typedef/structs/types - PascalCase

struct members - smallcase starting with underscore

File names - Capitalized seperated by underscore

🔗 Developer Links

portfolio linkedin Github X(Twitter) Static Badge

About

Highly optimized implementation of string in C with 48+ functions for manipulation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages