passing parameters to other files

 

Good evening.

I'm working on a project with a lot of files. 
As I didn't know exactly what the best was is to pass something to other files I tought I ask the communtity how they do it.

What ist the most beautiful/common way to solve this:


So in this example there is a Main file in wich 3 other files are included.
Let's say File C is the file with the code for the settings (for example a graphical interface with toggle buttons)

So now f.e. the settings code has the toggle "Allow trading"  with wich is worked in File A.

How do you guys, after the change of the value, pass the value from file c to file a.
What is the most used and also good solution?


One time i did it with pointers (But I hate pointers xD)

I also did it with custom events, but this I found not a really good solution. 

I'm exicted to hear from the pros how to do it :)


I know for a lot of you this is the simplest thing, but I needed to learn to code on my own and didn't work as a sofware ingeneer or something.

So the only way I can improve myself is trough the knowledge of others;)

 
You do not pass values to files. You pass parameters to functions. It is irrelevant whether the functions are in one file or included in others.