Learn C Function by Example 1 : Underscore and Alphanumerics are allowed
Basic Note :
- In C Programming Function name should be valid identifier.
- Valid Identifier includes following -
- Underscore - Alphabets - Digits
- C Function Name always starts with either alphabet or underscore.
- C Function Name may contain digit as ‘nth’ character where n is not starting character.
Learn by Program : Valid Example
#include<stdio.h> void printMessage(); int main() { printMessage(); } void printMessage(){ printf("Hello World"); }
Learn by Program : Invalid Example
#include<stdio.h> void printMessage(); int main() { printMessage(); } void print Message(){ printf("Hello World"); }
[tabs tab1="Valid Function Names" tab2="Invalid Function Names" ] [tab id=1] [checklist]
- addNumber()
- _add()
- print30()
- add Number()
- 30add()
- $print30()