Advertisement
Guest User

Untitled

a guest
Jul 27th, 2012
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. How to make global variable in libray project using MPLAB X IDE
  2. void abcTest(int n){
  3. // I want store n as global variable
  4. }
  5.  
  6. #ifndef _ABC_H
  7. #define _ABC_H
  8.  
  9. void abcTest(int n);
  10.  
  11. #endif;
  12.  
  13. #include "abc.h"
  14.  
  15. void main(void) {
  16. abcTest(10);
  17. }
  18.  
  19. extern int global_a;
  20. void abcTest(int n){
  21. global_a+=n;
  22. }
  23.  
  24. #ifndef _ABC_H
  25. #define _ABC_H
  26.  
  27. void abcTest(int n);
  28.  
  29. #endif;
  30.  
  31. #include "abc.h"
  32. int global_a;
  33.  
  34. void main(void) {
  35. abcTest(10);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement