Hello
I have a quick question. I have a module and in this module i have a linked list.
I want to give the linked list head to another module. So just that address.
Is this possible without writing a function?
Hello
I have a quick question. I have a module and in this module i have a linked list.
I want to give the linked list head to another module. So just that address.
Is this possible without writing a function?
To me, "modules" are very high-level software engineering terms, and are incredibly ambiguous in any other context (such as what you have given).
If you want to share anything, without exposing it via a function, then that variable simply must have global visibility.
Can you explain how you can produce a module in C that does something and doesn't involve writing a function?
im sorry i forgot to mention we cant use global variables
I don't think it's possible. If you can't have a global variable, or a "getter" function for a private/local variable, then, again I don't see how it would be accomplished.
An analogous question might be: how do you enter a locked house without access to the key and without asking the doorman? If your answer is to "break the window" or something else illegal, then maybe the programming-equivalent solution is illegal too.
Ok thank you for the information
I cant use global variable but they didn't say i cant use "getter" functions but c isnt objective so what do you mean with a getter function?
OK, that's the literal interpretation of what I said. But, of course, this isn't OOP so there's no "getter" function to get a "private member" of a "class".
In general (for non-OOP) languages, how do you pass information? With global variables and functions. But you said you can't do either of those, so I don't see a way to do it.
Hopefully the question wasn't ambiguous and worded improperly, of course you can pass information using things like pipes, files, or other shared memory approaches. However, the only way to do this is to write the code for it "in a function"--again, out of the question according to what you've told us. My guess is that whoever told you the requirements is ambiguous, or you misunderstood what they said. I'd try to clarify with them.
No, ok that was what i thought. I am going to ask monday some more information at one of the assistants. Thank you for your time