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                      
tip   To Refer this Site to Your Friends   Click Here
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 ?    1 Yes 0 No
Rajiv Kumar Koiri
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is the use of keyword volatile?? LG-Soft4
How to find the given no is odd or even without checking of any condition and loops. (Hint: Using array)  4
how to connect oracle in C/C++.  2
Who is invented by c? Infosys14
what is the defrenece between structure and union  5
write a own function to compare two strings with out using stringcomparition function? LG-Soft3
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); } ME3
How do we swap or interchange any 2 numbers without using Temporary variable...Anybody can pls answer it.. Thanks in Advance  7
how do u find out the number of 1's in the binary representation of a decimal number without converting it into binary(i mean without dividing by 2 and finding out the remainder)? three lines of c code s there it seems...can anyone help  2
What does extern mean in a function declaration?  2
f(char *p) { p=(char *)malloc(sizeof(6)); strcpy(p,"HELLO"); } main() { char *p="BYE"; f(p) printf("%s",p); } what is the output? Hughes6
what does " calloc" do? Cadence6
print ur name without using any semicolon in c/c++....  5
parkside's triangle.. create a program like this.. enter the size: 6 enter the seed: 1 output: 1 23 456 7891 23456 789123 sample2: enter the size: 5 enter the seed: 3 output: 3 45 678 9123 45678 parkside should not exceed 10 while its seed should only be not more than 9..  4
what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason  3
write a program to generate 1st n fibonacci prime number  5
what is the function of .h in #include<stdio.h> in c ? IBM9
wite a programme in c to linear search a data using flag and without using flags? TCS3
how to implement stack operation using singly linked list  1
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output CitiGroup4
 
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