On Tuesday, August 13, 2002, at 03:44 PM, Stef Telford wrote:

> Piers Harding wrote:
>>
>> I think your problem is a couple of things:
>> (1) dont't use main() as a function name
>> (2) allocate the space for the structure timep
>>
>
> Ahhh, understand. point 2 was mainly due to the
> horribly 'rusty' nature of my C programming skills.
> However, why is main() not allowed ? or rather, why
> does it conflict with Inline ?
>
> The concept of 'reserved' words or procedures is
> something that doesnt trouble me, however, main()
> is pretty much a 'de facto' in every single C program
> that has ever been typed.

Yeah, but you're not writing a C program.  You're writing a perl 
script that links against a C library behind the scenes.

When you write a C program, you don't have to tell the compiler 
which function is your "main" function for the program, right?  
That means that it already knows main() is the main function, 
which means that main() is somehow special.  That's why you 
can't use it.  It has nothing to do with Inline, really.  It has 
more to do with the fact that you're really writing a C library 
and linking to it in your perl script - and a bit to do with the 
fact that perl itself already has a function called main() (like 
all C programs)! =)

  -Ken

Reply via email to