Skip to content

Instantly share code, notes, and snippets.

@brookskindle
Created February 1, 2013 00:42
Show Gist options
  • Select an option

  • Save brookskindle/4688142 to your computer and use it in GitHub Desktop.

Select an option

Save brookskindle/4688142 to your computer and use it in GitHub Desktop.
quick way to find the size of an array in C
#include <stdio.h>
int main(void)
{
int arr[] = {45, 69, 27, 3, 99, -1, 0, 948, 34, 46};
int size = 0;
size = sizeof(arr) / sizeof(int);
printf("Size: %d.", size);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment