Skip to content

Instantly share code, notes, and snippets.

@sampottinger
Last active December 14, 2015 09:09
Show Gist options
  • Save sampottinger/5062518 to your computer and use it in GitHub Desktop.
Save sampottinger/5062518 to your computer and use it in GitHub Desktop.
Shows how to slice arrays in C
void slice_array(int * dest, int * source, int start_index, int end_index)
{
memcpy(dest, source+start_index, (end_index-start_index)*sizeof(int));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment