ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is main() function is user defined function or predefined function ?

user-image
تم إضافة السؤال من قبل Amit kumar Gupta Amit
تاريخ النشر: 2014/10/12
Umang Bhatnagar
من قبل Umang Bhatnagar

The main function is user implemented function whose prototype has been predefined by the compilers.

Ameer Khan
من قبل Ameer Khan , Project Lead Engineer , Alghanim industries

main() is a predefined function. when a program is set to compile. Compiler First looks for the main Function. Compiler starts compiling from main function

Falguni Desai
من قبل Falguni Desai , Assistant Professor , Vadodara Institute of Engg., Vadodara, Gujarat

Main is Predefined/System function. When operating system handover the control of program, it looks for the main() function in the program. You can say it is a entry point of the your program. 

 

Prototype for the function is predefined for the function but the actual task of the main()  is defined by the user.

viny goyal
من قبل viny goyal

In C programming Language main(0 function is user implemented (user defined) whose declaration is fixed in the compiler. hence we can say that main() is predefined and user defined too because programmer has to write function's body.

Here is the complete article on it.

Is main function in C programming language predefined or user defined? 

Shafat Ahmad
من قبل Shafat Ahmad , Trainer , Multichannel Educational Institute

When u compile and execute  a C program, the first thing your compiler or OS looks for in a program is the main() function..this is because all programs no matter how much complex start at the main()main() is a predefined function which can take only two arguments as:  main(argc, char *argv[ ]) argc = count of arguments

argv[ ] = is an array of strings or an array of char pointers

 

these are also known as Command Line Arguments

 

Moreover you usually do not use these arguments unless you want to supply arguments form the command line itself.

 

 

saurabh katiyar
من قبل saurabh katiyar , software engineer , huawei technology india pvt ltd

main() is predefined function whose prototype is such that it can accept only two arguments and return integer. User can neither modify number of arguments it takes nor return type.

Maaligai Parai Karuppa samy P
من قبل Maaligai Parai Karuppa samy P , Service & Embedded Engg , Indus Electronics, Chennai

Main Function is user derive function. only one main function in the program code.

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟