
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Function Specifier in C
In C and C++ there are some function specifiers. The function specifiers are used to specify the functions property. C++ has inline function specifier. In C there is _Noreturn function specifier. This is used to denote that one function will not return anything.
Example
#include<stdio.h> int myAdd(int a, int b){ return a + b; } main() { int x = 10, y = 20; printf("The value is: %d
", myAdd(x, y)); }
Output
The value is: 30
If the _Noreturn is used it will display some warning and the program will be terminated with some error.
Example
#include<stdio.h> _Noreturn int myAdd(int a, int b){ return a + b; } main() { int x = 10, y = 20; printf("The value is: %d
", myAdd(x, y)); }
Output
[Warning] function declared 'noreturn' has a 'return' statement [Warning] 'noreturn' function does return
Advertisements