Challange in C

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2008
Posts: 7
Reputation: somnathsarode is an unknown quantity at this point 
Solved Threads: 1
somnathsarode's Avatar
somnathsarode somnathsarode is offline Offline
Newbie Poster

Challange in C

 
0
  #1
Dec 29th, 2008
hi , everybody can any one write
a "c" programme without main()
function "please don't tell me
this is not possible "
If u know please tell me
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 206
Reputation: grumpier has a spectacular aura about grumpier has a spectacular aura about 
Solved Threads: 31
grumpier grumpier is offline Offline
Posting Whiz in Training

Re: Challange in C

 
1
  #2
Dec 29th, 2008
If by ``"c" programme'' you mean something that is compliant with one or both of the C standards, then there's only one answer: it's impossible. Your not wanting such an answer does not make it less true or correct.

If you wave a magic wand and decree that standard compliance doesn't matter, then the correct answer is whatever you (or anyone else) might define it to be. Microsoft have done this by introducing the WinMain() entry point which, for win32 applications, replaces the main() function. But that solution is specific to Microsoft operating systems and relies on specific compiler extensions that are outside the scope of the C standards.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,861
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 120
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso

Re: Challange in C

 
0
  #3
Dec 29th, 2008
Yes , replace that piece of code with direct assembly code
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Challange in C

 
0
  #4
Dec 29th, 2008
Originally Posted by somnathsarode View Post
hi , everybody can any one write a "c" programme without main()
function "please don't tell me
this is not possible "
If u know please tell me
Of course, it's possible in freestanding environments, see the C Std:
Two execution environments are defined: freestanding and hosted. In both cases, program startup occurs when a designated C function is called by the execution environment.
...
In a freestanding environment (in which C program execution may take place without any benefit of an operating system), the name and type of the function called at program startup are implementation-defined.
See also http://publications.gbdirect.co.uk/c..._standing.html
Last edited by ArkM; Dec 29th, 2008 at 7:42 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum


Views: 422 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC