Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

1 Answer
Vrundesha Joshi

The _Noreturn function specifier is used to tell to the compiler that the function will not return anything. If the program uses some return statement inside it, the compiler will generate compile time error.

Example Code

#include<stdio.h>
main() {
   printf("The returned value: %d\n", function);
}
char function() {
   return 'T'; //return T as character
}

Output

The program terminates abnormally
[Warning] function declared 'noreturn' has a 'return' statement

Now if it is a normal function it will work fine.

Example Code

#include<stdio.h>
int function() {
   return 86; //try to return a value
}
main() {
   printf("The returned value: %d\n", function());
}

Output

The returned value: 86

Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.