Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. sz = (sizeof foo) / (sizeof foo[0]);
  2.  
  3. main()
  4. {
  5. int a[]={1,2,3,4,5,6,7}
  6. int i;
  7. clrscr();
  8. for (i=0;i<=((sizeof(a)/sizeof(int));i++)
  9. {
  10. puts(a[i]);
  11. }
  12. getch();
  13. }
  14.  
  15. int main(int argc, char *argv[]) {
  16. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  17. int retVal = UIApplicationMain(argc, argv, nil, nil);
  18. [pool release];
  19. return retVal;
  20. }
  21.  
  22. float ptArray[] = {97.8, 92.3, 89.4, 85.7, 81.0, 73.4, 53.0, 42.3, 29.4, 14.1};
  23.  
  24. int x = sizeof(ptArray)/sizeof(ptArray[0]);
  25.  
  26. NSLog(@"array count = %d", x);
  27. // result: array count = 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement