Question: twos complement representation of an 8 - bit binary number. ) Functions having array parameters The following declares a function that has a parameter a

twos complement representation of an 8-bit binary number.)
Functions having array parameters
The following declares a function that has a parameter a that is an array of int :
void print(inta[]){}
In C, an array parameter always decays to a pointer; in other words, the function above is equivalent to:
void print (int*a){}
and many traditional C programmers will declare their functions in this way.
Suppose that you specify the size of the array using an int literal:
??don't do this
void print(inta[8]){}
can be called without a compiler warning with an int array of any size.
C99 slightly improved things by allowing the programmer to declare the function like so:
??ok and recommended todo this
void print(inta[static8]){}
called with an array having fewer than 8 elements (the compiler cannot easily do so because C does not keep track of the size of dynamically allocated arrays).
The functions in this question have array parameters where the minimum size of the array is declared using the static keyword.
 twos complement representation of an 8-bit binary number.) Functions having array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!