Skip to content

Commit

Permalink
Created README
Browse files Browse the repository at this point in the history
  • Loading branch information
B3W authored Mar 25, 2019
1 parent 97b21e3 commit 3cc5c7a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Dynamic C-String Splitting
### This function can be used for dynamically splitting a C-string on a given delimiter when the string length is not known.
There are two locations within the code where modifications are possible:
+ The initial capacity of the split array can be changed on line 17
+ The split array resizing logic can be changed on line 38

Changing the array resizing logic allows either space or time efficiency to be given priority.
Currently, the array size is doubled on each resize to minimize the calls to 'realloc' without wasting lots of space.
Alternatively, you could simply add one to the array size which would cause 'realloc' to be called more but waste zero space in memory.

0 comments on commit 3cc5c7a

Please sign in to comment.