C++ Program to Show Unreachable Code Error
Unreachable code is a compile-time error in languages like C++, Java, and C or Unreachable code error occurs when the code can’t be compiled; but why it is just a warning in C++ & C ? Warnings are a way that the compiler indicates that the particular mentioned thing might become an error in future.
Example:
C++
#include <iostream>
using namespace std;
int c();
int main()
{
cout << c() << endl;
return 0;
}
int c()
{
int a = 3;
return a;
int b = 6;
cout << b;
}
|
Last Updated :
25 Jul, 2022
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...