KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am working in C, and have some variables that I don't want to be global, but I do want to have get and set methods for them that can be accessed "Globaly" outside of the file. I am used to doing this in Java, but C is very different in this manner. Basically I am looking for something that follows this pseudo Code, but I have not been able to find anywhere with examples that I might look at. main.c #include data.h set(b); datalog.c #include data.h get(b); data.c private int c; set(b){ c = b; } get(c){ return c; }
Tags (comma-separated)
Save Edits
Cancel