There are two files ac and bc . In ac , I have implemented the main main function, the tratata variable and contains the prototype of the function int foo(int n, int * a) , I cannot pass any parameters to this function. In another bc file, I have implemented this function, and the variable tratata should be used tratata . And how to pass this variable (not as a function argument), I honestly do not understand.
|
1 answer
Elementary implementation example :
int tratata = 42; // определение глобальной переменной void f(void); // прототип функции из другого файла int main() { f(); } #include <stdio.h> extern int tratata; // говорит о том, что переменная определена в другом файле void f(void) { printf("%d\n", tratata); } |
tratatavariable 2) show the code - maybe there is no problem at all. - PinkTux