• Register
100 points
7 2
Welcome to Kodlogs, programming questions and answer website.

Literals (constants), identifier and (expression) are primary expressions in C++. List of primary expressions is extending. Keywords like this, scope resolution operator, name and the class destructor are included in primary expressions of C++. Let’s discuss error.

Cause

If we include any keyword in the header then the preprocessor will remove that keyword if we use that word anywhere in the program or any other cpp file which contains that keyword as header.
For example
#include <iostream>
#define armor ;
using namespace std;
int main() 
{
    int n;
    n = armor;
    return 0;
}

Here we have used keyword armor as header. So we cannot use it further. If we use that then it will cause error. Like this n = armor;  is turned into n = ; by the preprocessor.

Solution

The solution is simple we have to use different name keyword in our source file.

#include <iostream>
#define armor ;
using namespace std;
int main() 
{
    int n,m;
    n = m;
    return 0;
}

Hope this will help you.
 

100 points
7 2