Can i overload operator == so it allow me compare two char[], C/C++ Programming

Assignment Help:

Q: Can I overload operator == so it allow me compare two char[] by a string comparison?

A: No: at least one operand of particular overloaded operator should be of some user-defined type (most of the time it means a class).

However even if C++ let you to do this, which it doesn't, you wouldn't wished to do it anyway as you really should be using a std::string-like class instead of an array of char in the first place since arrays are evil.

 


Related Discussions:- Can i overload operator == so it allow me compare two char[]

Loan negotiation is usually not a straightforward ta, Ask question #Minimum...

Ask question #Minimum 1Loan negotiation is usually not a straightforward task. A type of loan is the discount installment loan. This type of loan has the following characteristics.

Program that predicts users age, Program: Write a program that predicts...

Program: Write a program that predicts users' age (0-128 years old) with at most 7 questions. The game starts with asking the user whether he/she is younger or older than G (an

CptS 121 Program Development & Design program design in C, Write a program...

Write a program that performs character processing on 10 characters read in from a file, and writes the results to output files. Do NOT use loops or arrays to solve this problem. N

Poop, hwat is the area fsdjlakl;aeklfjtealrtl;gka

hwat is the area fsdjlakl;aeklfjtealrtl;gka

Develop a telephone billing system, Project Description: My project is a...

Project Description: My project is about telephone billing system. This project was my project in my college life. The project is quite easy, i needed C++ programming language..

Luminous Jewels - The Polishing Game, Byteland county is very famous for lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Introduction of c, Discuss the saleint featuresand application of c

Discuss the saleint featuresand application of c

Araay, create two array names and grade .in first array you have to store t...

create two array names and grade .in first array you have to store thease 10 names 1.a,2.3.r,4.s,5.l,6.k,7.n,8.b,9.z,10.d you have to enter grades for thease students.te program mu

C++ programming, Write a program to convert English units to metric (e.g., ...

Write a program to convert English units to metric (e.g., miles to kilometers, gallons to liters, etc.). Include a specification and a code design.

Title, #questionAt a shop of marbles, packs of marbles are prepared. Packet...

#questionAt a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd