why we should use main in C

Answer Posted / naendra allam

Asume abc.c is the program
--------\abc.c\---------
#include <stdio.h>
#include <stdlib.h>

int naren()
{
printf("Hi--- Ther is no main() here.\n");
exit(EXIT_SUCCESS); //Not supposed to use 'return 0;'
}
-----------------------
//compilation with GCC
$gcc -c abc.c

---> which generates abc.o

$ld --dynamic-linker /lib/ld-linux-so.2 -oabc abc.o -enaren
-lc

---> which generates executable 'abc'

$./abc
Hi--- Ther is no main() here.

--->you ran the program.

ALL THE BEST

Narendra Allam
IVTL INFOVIEW

Is This Answer Correct ?    12 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to Load a locale file into the THTML component ?

1326


How to Modify application server SQL from the client?

1164


Does Delphi have an equivalent to the Visual Basic SendKeys function?

1571


How to Prevent changing pages in a page control?

1293


How to detect the CPU type of the computer the application is running on?

1369






How to Get the current line number of a TMemo?

1844


How to use far pointers?

1623


Why do I get compile errors accessing the Sender object in events?

549


How to Change the location of the object repository ?

1385


How to retrieve a list of assigned properties ?

1229


How to use the InterBase API security functions to add, modify and delete users?

1196


How to Display a bitmap on the client area of an MDI parent form?

1284


How to Select a cell in a DBGrid ?

1651


How to Change the font in a hint window ?

1373


How to Disable a radio button in a TRadioGroup?

1456