Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/08/01 01:59
Read: times


 
#14822 - RE: Passing Arrays?

You can also use the array brackets for better readability as follows...
Note, this example compiled on gcc, an 8051 compiler was not tried, but you would want to add 'idata'.

<>< Lance.

<code>
char test(unsigned char array[]){
 char i, temp;
 temp = 0;
 i = 0;
 for(i=0;i<9;i++){
  temp = temp + array[i];
  array[i] = 0;
 }
 return temp;
}

unsigned char global_array[] = {1,2,3,4,5,6,7,8,9,10};

main(){
 test(global_array);
}
</code>

List of 4 messages in thread
TopicAuthorDate
Passing Arrays?            01/01/70 00:00      
RE: Passing Arrays?            01/01/70 00:00      
RE: Passing Arrays?            01/01/70 00:00      
RE: Passing Arrays?            01/01/70 00:00      

Back to Subject List