943,650 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 524
  • C RSS
Dec 29th, 2008
0

Challange in C

Expand 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
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
somnathsarode is offline Offline
7 posts
since Dec 2008
Dec 29th, 2008
1

Re: Challange in C

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.
Reputation Points: 193
Solved Threads: 32
Posting Whiz in Training
grumpier is offline Offline
206 posts
since Aug 2008
Dec 29th, 2008
0

Re: Challange in C

Yes , replace that piece of code with direct assembly code
Reputation Points: 769
Solved Threads: 128
Banned
ithelp is offline Offline
1,910 posts
since May 2006
Dec 29th, 2008
0

Re: Challange in C

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:
Quote ...
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.
Reputation Points: 1234
Solved Threads: 347
Postaholic
ArkM is offline Offline
2,001 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Understanding pointers
Next Thread in C Forum Timeline: Need help changing the address of an array





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC