- 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.
- 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.
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