February 14th, 2013, 06:25 AM
Initializing datatypes in another function
Hi All ,
I would like someone to guide me as to how to go about doing this . I would like to initialise all my dataypes in one function and call them from main . Is this a possiblity ?
int t = 4 ;
int time ;
printf(" t = %d", t);
February 14th, 2013, 06:34 AM
- you need to use global variables, initialized inside your function, which is not often recommended as there could be unexpected side effects leading to ambiguous situations when the program becomes larger in future
- Or an initializing function returning the initialized variables, but again the types must already have been declared globally.