News for hackers. Stuff that matters.
Re:Linus on compiler warnings and code reviews by esaym on Wednesday September 23, 2015 @04:25PM (#10267898)
Because as Linus stated: "array arguments in C don't actually exist"

The bracket notation ex: myarray[2] is actually just a sugar syntax for: * (myarray+2)

An array is nothing more than an address and a (hopefully) know length. Not really a "data structure" or object by no means.

You could definitely roll your own though with something like:

  struct  {
    char * arr,
    int size
  } my_struct;
  
  for(int i = 0; i < my_struct.size; i++){
    printf('%x', my_struct.arr[i]);
  }

  ect,
Re:Linus on compiler warnings and code reviews by acconsta on Wednesday September 23, 2015 @04:29PM (#10267932)
Yeah. But why is that the behavior specified by the standard?