Skip to content

Instantly share code, notes, and snippets.

@igorski89
Created March 12, 2010 17:29
Show Gist options
  • Save igorski89/330551 to your computer and use it in GitHub Desktop.
Save igorski89/330551 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void func(int *a) {
printf("%lu\n",sizeof(a)/sizeof(int));
}
void func1(int a[]) {
printf("%lu\n",sizeof(a)/sizeof(int));
}
int main(int argc, char **argv) {
int a[5];
printf("%lu\n",sizeof(a)/sizeof(int));
func(a);
func1(a);
return 0;
}
// вывод
5
2
2 //ну и толку с таких массивов?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment