I'm writing a pretty basic c++ program and the same error keeps coming up "char n: redefinition."
#include <iostream>
#include <string>
using namespace std;
int main()
{
char n;
cout << "Enter a character: ";
char n = static_cast<int >(n + 1);
cin >> n;
cout << n;
system("pause") ;
}
#include <iostream>
#include <string>
using namespace std;
int main()
{
char n;
cout << "Enter a character: ";
char n = static_cast<int >(n + 1);
cin >> n;
cout << n;
system("pause") ;
}
Comment