not accepting that == sign

#include<iostream>
#include<string.h>
using namespace std;

class laptop
{
private:
enum {max=80};

char name[max];
int passwd[max];
char company[max];
int processor[max];
float os[max];
int ram[max];
int price[max];
char yesorno[max];
public:
void login()
{
cout<<"\t"<<"\t"<<"ADMIN PANEL"<<endl;
cout<<"--------------------------------"<<endl;
cout<<"Enter your Name"<<"\t"<<name;
while(name =="Sana");
{
cout<<"Next Step";
}
cout<<"Enter the password"<<"\t"<<passwd;

while(passwd=="1234")
{
cout<<" WELCOME ";
}
}
void getdata()
{
cout<<"Enter the details of the laptop"<<endl;

cout<<"Laptop Company :"<<"\t"<<company;
cout<<"Processor :"<<"\t"<<processor;
cout<<"OS :"<<"\t"<<os;
cout<<"RAM :"<<"\t"<<ram;
cout<<"Price :"<<"\t"<<price;
}
void editdata()
{

cout<<"Do you want to edit data?"<<"\t"<<yesorno;
while( yesorno=="yes");
{
cout<<"Laptop Company :"<<"\t"<<company<<endl;
cout<<"Processor :"<<"\t"<<processor<<endl;
cout<<"OS :"<<"\t"<<os<<endl;
cout<<"RAM :"<<"\t"<<ram<<endl;
cout<<"Price :"<<"\t"<<price<<endl;
}

}};

int main()
{
laptop obj1;
obj1.login();
obj1.getdata();

obj1.editdata();
return 0;
}





C:\Users\Sana\Desktop\lol.cpp(30) : error C2440: '==' : cannot convert from 'char [5]' to 'int [80]'
There is no context in which this conversion is possible
C:\Users\Sana\Desktop\lol.cpp(30) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.
Last edited on
Use std::strcmp to compare C strings (char*) or use == and make sure at least one of the strings you compare is a std::string.
Topic archived. No new replies allowed.