Name of function cannot be register Pseudo variables


Register pseudo variables are reserved word of c language. So we cannot use these word as a name of function otherwise it will cause of compilation error.

#include<stdio.h>
int main(){
   int c;
   c=_AL();
   printf("%d",c);
   return 0;
}

int _AL(){
   int i=5,j=5;
   int k=++j + ++j+ ++j;
   i=++i + ++i+ ++i;
   return k+i;;
}

Output: Compilation error
Explanation: _AL is register Pseudo variables in c



Definition of function in c
Name of function includes only alphabets, digit and underscore.
First character of name of any function must be an alphabet or underscore.
Name of function cannot be any keyword of c program.
Name of function cannot be global identifier.
Name of function cannot be exactly same as of name of function in the same scope.
Name of function is case sensitive
Name of function cannot be register Pseudo variable

No comments: