Skip to content

Instantly share code, notes, and snippets.

@DimitriPapadopoulos
Created May 18, 2020 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DimitriPapadopoulos/7ea5340c94c16c802367e6b42e7e2af3 to your computer and use it in GitHub Desktop.
Save DimitriPapadopoulos/7ea5340c94c16c802367e6b42e7e2af3 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
int main(void)
{
size_t l = ARRAY_SIZE("[xxx.xxx.xxx.xxx], ns [xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx]");
printf("ARRAY_SIZE(\"[xxx.xxx.xxx.xxx], ns [xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx]\") = %lu\n", l);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment