I want to create a library in C using MPLAB X IDE(ide for PIC developing).
My library ABCLib has one simple source file like this:
file abc.c
void abcTest(int n){
// I want store n as global variable
}
To using this library in MyProject i have to create abc.h inside MyProject header folder:
file abc.h
#ifndef _ABC_H
#define _ABC_H
void abcTest(int n);
#endif;
file MyProject.c(main file)
#include "abc.h"
void main(void) {
abcTest(10);
}
Now, i want to store n as global variable, so, after a call to abcTest() i can retrieve the value of n whereever i want.
I'm developing a library with intention to reuse it in all my projects.