Is it possible to run a c program without using main?If yes
HOW??
Answers were Sorted based on User's Feedback
Answer / elahi
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 ? | 41 Yes | 7 No |
Answer / rajiv kumar koiri
#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 ? | 16 Yes | 3 No |
Answer / adesh
#define adesh(x,y) y##x
int adesh(in,ma) (void)
{
;
}
| Is This Answer Correct ? | 13 Yes | 3 No |
Answer / vrushali
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 ? | 9 Yes | 1 No |
Answer / ramabrahmam
hi adesh,
your logic is not suited to numbers.
suppose, if we write "printf" as
for two integers a,b
printf("sum of a and b is",a+b);
for this statement it only displaying the letters
within the double quotes.i.e., sum of a and b is .
it is not displaying anything after that.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / bhavin
hi friends plz help me i want detail how can it
possible...??plz friend,,,also to adesh,valli,elahi...all
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / vrushali
HI Valli,
Still the same problem.
/usr/bin/ld: warning: cannot find entry symbol _start;
defaulting to 080481a4
| Is This Answer Correct ? | 2 Yes | 4 No |
Explain what is gets() function?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
program for reversing a selected line word by word when multiple lines are given without using strrev
Why clrscr is used after variable declaration?
What are the usage of pointer in c?
Explain how can you check to see whether a symbol is defined?
What is assert and when would I use it?
What is spark map function?
main() { int i,n=010; int sum=0; for(i=1;i<=n;i++) {s=s+i; } printf("%d",&s); getch(); }
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
Explain enumerated types.