Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Difference in C programming embeded µC projects having no (very small) main.c

oversprayoverspray Member Posts: 14 ✭✭

Hi, I encountered a little problem working on a IDE project programming a µc in C. This differes to C programming, in that way, that a program is written around a main.c.
Programming a µc doesnt necessarily need a main.c, and if it does its rather small. Everything is being programmed through functions.
And there I found it impossible to pass values or refferences the way I am used to when programming c.
Also when I declare a variable outside any function on a source file, this variable can not be read from within a function even if it`s on the same source file.
I was able to read variables as globals, when I declared it on a header.h. This was the only way I was able to read variables outside its own function. But this is not a good practice.

Can someone explain to me how to pass parameters from one function to another in such a case? If possible ?
Thanks,
John

Sign In or Register to comment.