Skip to content
/ strarr Public

This small C library contains functions for storing multiple, typically associated, strings in arrays.

License

Notifications You must be signed in to change notification settings

pij-se/strarr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

strarr

This small C library contains functions for storing multiple, typically associated, strings in arrays.

The first array element constitutes the string count, while the subsequent elements are pointers to strings.

Below is an example of how to use the functions.

int main(int argc, char *argv[])
{
	char **array;
	int i;

	array = strarr_alloc(4, "Hello", ", ", "world", ".\n");
	for (i = 0; i < strarr_length(array); i++)
		printf("%s", strarr_get(array, i));
	strarr_free(array);
	return 0;
}

Copyight (c) 2022 Johan Palm johan@pij.se
All rights reserved.
Published under the MIT License.

About

This small C library contains functions for storing multiple, typically associated, strings in arrays.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages