how to create c progarm without void main()?



how to create c progarm without void main()?..

Answer / surya bhagavan s

#include<stdio.h>
#include <unistd.h>

_start()
{
_exit(my_main());
}

int my_main(void)
{
printf("Hello\n");
return 42;
}

for compilation

gcc -o3 -nostartfiles example.c

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More C Interview Questions

how could explain about job profile

0 Answers  


inline function is there in c language?

4 Answers  


What are the advantages of Macro over function?

1 Answers  


Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++) main(); } Then what is the output of the program?

6 Answers  


Explain zero based addressing.

0 Answers  






What does the c preprocessor do?

0 Answers  


In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.

0 Answers  


What is difference between array and structure in c?

0 Answers  


Explain what are header files and explain what are its uses in c programming?

0 Answers  


How can a number be converted to a string?

1 Answers  


code for reverse alternate words from astring

1 Answers   IBM,


What Is The Difference Between Null And Void Pointer?

0 Answers   TCS,


Categories