Hi. Below are 2 functions:
byte self_test(void)
{
...
...
testing();
}
byte testing(void)
{
...
...
self_test();
}
From the testing function, I'm able to jump to the self_test function since the self_test function is declared above the testing function. However, I'm unable to jump to the testing function if I'm in the self_test function because the testing function is declared below the self_test function. Anyone knows a way to jump between these 2 functions continuously? Thx
Solved! Go to Solution.
Do you mean compiler produces warnings or doesn't compile at all because of missing testing() prototype? Then add it above self_test():
byte testing(void);
Do you mean compiler produces warnings or doesn't compile at all because of missing testing() prototype? Then add it above self_test():
byte testing(void);
kef wrote:Do you mean compiler produces warnings or doesn't compile at all because of missing testing() prototype? Then add it above self_test():
byte testing(void);
Thx for the reply. The compiler cannot compile at all because it cannot find testing(). And if I put testing() above self_test(), then the compiler will not be able to find self_test(). Therefore I'm only able to jump from one function to the other, but not vice versa.. lol. I've tried inserting "byte testing(void);" above self_test(). But the compiler still cannot compile
Lundin wrote:
If prototypes doesn't solve it, the problem is related to something else. Post the code.
Here's the portion I added. I inserted "byte testing(void);" above self_test(), but it still doesn't compile
byte testing(void);
byte self_test(void)
{
...
...
testing();
}
byte testing(void)
{
...
...
self_test();
}
Cryptical,
What does the complier reports? Can you post here the compiler error message? I guess the problem is somewhere else.
Stanish
stanish wrote:Cryptical,
What does the complier reports? Can you post here the compiler error message? I guess the problem is somewhere else.
Stanish
Hi. I've tested kef's method again. Now it works. I don't know what went wrong before. Lol. Thx for the help guys