l-value complaint from compiler
this is my code:
Code:
#include <iostream>
using namespace std;
int primedivisor ( int original)
{
int vr;
int collective = 1;
int n = 2;
while (n != collective)
{
if (0 = original % n)
{
vr = n;
original /= n;}
else {n++;}
}
return vr;
}
int main()
{int x;
cin >> x;
cin.ignore();
cout << primedivisor (x);
cin.get();
return 0;}
and this is my error:
a.cpp<12> : error C2106: '=' : left operand must be l-value
I tried making pointers and sticking them in, putting 1 instead of "original", switching it around, and making all sorts of different types of variables (char, float, etc.)
nothing can take away the message.