ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
Is it possible to run a c program without using main?If yes 
HOW??
 Question Submitted By :: Sourisengupta
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 1
Yes it is possible to run a c program with out main for this
you need to supply astart(assembly procedure CRT) address in
the command line.
 
Is This Answer Correct ?    19 Yes 4 No
Elahi
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 2
no
 
Is This Answer Correct ?    2 Yes 11 No
Rupali Yadav
 
 
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 3
Thanx elahi....
 
Is This Answer Correct ?    4 Yes 0 No
Sourisengupta
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 4
in linux while compilation we u mention -nostartfiles it 
will work
#include<stdio.h>
abc()
{
    printf("hello");
}
 
Is This Answer Correct ?    2 Yes 5 No
Valli
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 5
Hi Valli,

I tried the solution provided by you. It doesnot work. 

Please chk the compliation procedure.
gcc -g -nostartfiles main.c


I am getting the following: 
/usr/bin/ld: warning: cannot find entry symbol _start;
defaulting to 080481a4
 
Is This Answer Correct ?    2 Yes 0 No
Vrushali
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 6
just compile as
cc -nostartfiles main.c
 
Is This Answer Correct ?    1 Yes 1 No
Valli
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 7
HI Valli,

Still the same problem.

/usr/bin/ld: warning: cannot find entry symbol _start;
defaulting to 080481a4
 
Is This Answer Correct ?    0 Yes 0 No
Vrushali
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 8
#define adesh(x,y) y##x

int adesh(in,ma) (void)
{
;
}
 
Is This Answer Correct ?    0 Yes 0 No
Adesh
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 9
hi friends plz help me i want detail how can it 
possible...??plz friend,,,also to adesh,valli,elahi...all
 
Is This Answer Correct ?    0 Yes 0 No
Bhavin
 
  Re: Is it possible to run a c program without using main?If yes HOW??
Answer
# 10
#include<stdio.h>
#define decode(s,t,u,m,p,e,d) m##s##u##t
#define begin decode(a,n,i,m,a,t,e)

int begin()
{
printf("Hello");
}
 
Is This Answer Correct ?    2 Yes 0 No
Rajiv Kumar Koiri
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is the diference between pointer to the function and function to the pointer?  2
Which of the Following will define a type NODE that is a node in a Linked list? A)struct node {NODE*next;int x;};type def struct node NODE; B)typedef struct NODE {struct NODE *next;int x;}; C)typedef struct NODE {NODE *next;int x;}; D)typedef struct {NODE *next;int x;}NODE; Accenture4
write a recursive program in'c'to find whether a given five digit number is a palindrome or not  1
n=7623 { temp=n/10; result=temp*10+ result; n=n/10 } Wipro4
The C language terminator is a.semicolon b.colon c.period d.exclamation mark TCS3
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } CitiGroup15
Give the output for the following program. #define STYLE1 char main() { typedef char STYLE2; STYLE1 x; STYLE2 y; clrscr(); x=255; y=255; printf("%d %d\n",x,y); } ADITI1
what is the associativity of bitwise OR operator?  1
write a function which accept two numbers from main() and interchange them using pointers?  3
what are the uses of structure? HCL5
what is data structure  4
Given a single Linked list with lakhs of nodes and length unknown how do you optimally delete the nth element from the list? Oracle1
How do you write a program which produces its own source code as its output?  3
write a program in c language for the multiplication of two matrices using pointers? Ignou5
what will be the output: main(){char ch;int a=10;printf("%d",ch);} Wipro29
when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none HCL4
Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;  7
how to exchnage bits in a byte b7<-->b0 b6<-->b1 b5<-->b2 b4<-->b3 please mail me the code if any one know to rajeshmb4u@gmail.com Honeywell3
write a addition of two no. program with out using printf,scanf,puts .  3
What is the main differences between C and Embedded C?  2
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com