Lesson 14 of 23
FunctionsFunctions
10 min 25 XP
Function ஒரு பெயர் கொண்ட code தொகுப்பு. return type, பெயர், parameters. main()-க்கு கீழே function எழுதினால் மேலே ஒரு prototype (அறிவிப்பு) வேண்டும்.
A function is a named block of code with a return type, a name and parameters. If you define it below main(), declare a prototype above main().
Example: edit me and press Run
Press Run to see the result here.C-ல் arguments மதிப்பாக (call by value) அனுப்பப்படும்: function உள்ளே parameter-ஐ மாற்றினால் main-ல் உள்ள variable மாறாது. மாற்ற வேண்டுமெனில் pointers தேவை (அடுத்த module).
C passes arguments by value: changing a parameter inside a function doesn't change the caller's variable. To change it you need pointers (next module).
Example: edit me and press Run
Press Run to see the result here.