Hey, worlds worst programmer here with another(hopefully) simple question. I'm trying to create a palindrome using five variables. Only problem is that the feedback says they aren't initializing for some reason.
// Lab 2, Programming Conventions, to read and print two sets of inputs, with two calculated values.
// Programmer:
// Editor(s) used: XP Notepad
// Compiler(s) used: VC++ 2010 Express
// preprocessor directive for streaming, variable, and ending statement.
#include <iostream>
using std::cin;
using std::cout;
using std::ios;
using std::endl;
// preprocessor directive for string, and variable string.
#include <string>
using std::string;
using std::getline;
int main() {
//Jesse Burns program number 1: the basics.
cout << "Lab 1, Programming Basics" <<endl;
cout << "Programmer: " <<endl;
cout << "Editor(s) used: XP Notepad" <<endl;
cout << "Compiler(s) used: VC++ 2010 Express" <<endl;
int num1;
int num2;
int num3;
int num4;
int num5;
string buf;
cout << "Enter a number to determine a palindrome or Q to quit:"<<endl;
cin >> buf; num1,num2,num3,num4,num5 = atoi(buf.c_str());
cin.ignore(1000,10);
if(num1 == num5 && num2 == num4)
{
cout << num1 << num2 << num3 << num4 << num5 << "is a palindrome"<<endl;
}
elseif (buf == "Q" || buf == "q")
cin.get();
}
I honestly can't understand why. Everything seems to check out fine on my end. Any pointers?