Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. //GLobal Variables
  2. uint8_t my_array[ MAX ];
  3.  
  4. ...
  5.  
  6. int manipulateArray( uint8_t value )
  7. {
  8. for( uint8_t i=0; i<MAX; i++ )
  9. {
  10. if( -1 == my_array[ i ] )
  11. my_array[ i ] = value;
  12. }
  13. }
  14.  
  15. //GLobal Variables
  16. uint8_t my_array[ MAX ];
  17. uint8_t idx = 0;
  18.  
  19. ...
  20.  
  21. int manipulateArray( uint8_t value )
  22. {
  23. my_array[ idx++ ] = value;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement