Re: Re: [c-prog] How to execute the user defined ...
Sayan Mukherjee <[email protected]> Tue, 3 Jan 2006 11:30:53 +0530
| Newsgroups | gmane.comp.programming.cppug |
|---|---|
| Message-ID | <[email protected]> |
Hi, Just a wild hunch: what is the extension of your source file when this compiles on Solaris? Hope it is not something like *.C* or *.c++* . Rgds, Sayan On 12/30/05, Shiju Krishnan <[email protected]> wrote: > > #include<stdio.h> > int before() > { > printf("HELLO\n"); > return 1; > } > int i = before(); > > int main() > { > printf("main\n"); > return 0; > } > > this work out on solaris > > Regards > Shiju K. > > On 12/28/05, sumit kumar <[email protected]> wrote: > > > > At 05:54 2005-12-27, Jitendra Kumar wrote: > > >Hi all to the members of wonderful forum, > > > > > >Y'day i had an interview, this was the qstn: > > > > > >Write a program which will execute before the main > > >function, dont use #pragma or compiler level programs? > > > > what language? If C++, trivial: write a struct > > or class with your program in the constructor. > > define an instance as a global variable. > > > > in C? I have no idea. > > > > > > >Pls post the answer. > > >Thanku, > > > > > >Jitendra > > > > > > *Maneesh Anand Samria < [email protected]>* wrote: > > > > Lets try this > > #include<stdio.h> > > int before() > > { > > printf("HELLO"); > > return 1; > > } > > int i = before(); > > void main() > > { > > printf("main"); > > } > > > > This wont work since initialiser must be a constant. > > > > Regards, > > Sumit kumar > > > > ------------------------------ > > Yahoo! for Good - Make a difference this year.<http://us.rd.yahoo.com/mail_us/taglines/charity/*http://brand.yahoo.com/cybergivingweek2005/> > > ------------------------------ > > YAHOO! GROUPS LINKS > > > > > > - Visit your group "cppug <http://groups.yahoo.com/group/cppug>" > > on the web. > > > > - To unsubscribe from this group, send an email to: > > [email protected]<[email protected]?subject=Unsubscribe> > > > > - Your use of Yahoo! Groups is subject to the Yahoo! Terms of > > Service <http://docs.yahoo.com/info/terms/> . > > > > > > ------------------------------ > > > > > > ------------------------------ > YAHOO! GROUPS LINKS > > > - Visit your group "cppug <http://groups.yahoo.com/group/cppug>" on > the web. > > - To unsubscribe from this group, send an email to: > [email protected]<[email protected]?subject=Unsubscribe> > > - Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/>. > > > ------------------------------ > -- =========================== Sayan Mukherjee [ Email: [email protected] ] [ Tel: +91-9867077375 ] ===========================