[Glade-users] Command Line Arguments (argv) in callbacks.c




Dana subota 21. februar 2004. 11:30, rpadalia qatar net qa je napisao/la:
Hi List,
Possibly this is very basic C question.
I know how to use command line arguments - argv[] in main.c. How can I
use
my command line options in code in callbacks.c? Any clue on this will be
highly appreciated. Thanks in advance.

I think that you will need to copy argv[] array in some global variable,
or to
store its memory address in some global variable, and than to access to it
from callback.

On another way, you can connect callback to signal in main function, and
than
simple pass a memory address of argv as a user data in callback call.
I would like to suggest a better soln problem
( i would like to recommend it to all developers)
1. in your main.c file include "callbacks.h" after all the other files have
been included
2. append the contents of callcbacks.c to main.c
3 delete callbacks.c and remove any refernces to it from the makefile
(either manually or from inside Anjuta - the ide i use)






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]