Cant get this to work
Im trying to compare two character-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#include <iostream>
#include <string.h>
#include <string>
#include <sstream>
#include <fstream>
using namespace std;
int main()
{
char h[5];
char l[5]="Open";
cout<<"*****Menu*****\n"<<"Open\n"<<"New\n";
cin>>h;
if (h==l)
{
int i;
cout<<"works";
cin>>i;
}
else
{
cout<<"Hey";
}
}
|
But instead it always returns the else statement.
Any Help?
Last edited on
Ok thanks
Topic archived. No new replies allowed.