Re: main(int argc, char *argv[])





Dan Henry wrote:
> jmccloughlin@xxxxxxxxxxx (Sokar) wrote:
>
>
>>I have my main function set up as
>>
>>int main(int argv, char *argv[])
>>
>>so taht i can read in a variable which is passed to the program on the
>>command line. The problem is that main calls other functions and some
>>of them need to start jump to the start of main.
>
> ^^^^
> ===SNIP===
>
>>argv[1] is just used once as soon as main starts up and never used
>>again after, so i dont mind if i loose the ability to read from it, i
>>just need to be able to call main from another part of the program
>
> ^^^^
>
> So which is it -- jump or call? If 'jump', there's setjmp/longjmp.

Calvin: Do we have any chainsaws in the house?
His Mother: No.
Calvin: Then how am I supposed to learn to juggle?

Sokar has asked how to do something that is almost
certainly better not done. Other points in his question
suggest he's not an experienced C juggler, certainly not
ready for the perils of longjmp(). Find out what he's
trying to do, not what he's asking: there's very likely
a better (and easier) way to get to his real goal.

But unless you like watching involuntary amputations,
please don't tell him where the chainsaws are.

--
Eric.Sosman@xxxxxxx

.