2 Replies - 2225 Views - Last Post: 17 March 2013 - 04:06 PM Rate Topic: -----

#1 helloworld1234  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 24
  • Joined: 09-February 13

IntelliSense error : more than one operator "=" matches these

Posted 17 March 2013 - 03:18 PM

Hello,

I am trying to create a class as shown below(this is just part of my code), but when i create the empty constructor, intellisense on visual studio gives me an error saying "IntelliSense: more than one operator "=" matches these operands" for ssn=0. can someone explain why that is, and how it can be fixed?



#include <iostream>
#include <sstream>
#include <string>

using namespace std;

class SocialSecurityNumber
{

private:
	string ssn;

public:
	SocialSecurityNumber()
	{ 
		ssn = 0;
	}







thanks

Is This A Good Question/Topic? 0
  • +

Replies To: IntelliSense error : more than one operator "=" matches these

#2 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3488
  • View blog
  • Posts: 11,902
  • Joined: 12-December 12

Re: IntelliSense error : more than one operator "=" matches these

Posted 17 March 2013 - 03:37 PM

You have declared ssn as a string but are trying to assign it a numerical value.
Was This Post Helpful? 1
  • +
  • -

#3 helloworld1234  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 24
  • Joined: 09-February 13

Re: IntelliSense error : more than one operator "=" matches these

Posted 17 March 2013 - 04:06 PM

View Postandrewsw, on 17 March 2013 - 03:37 PM, said:

You have declared ssn as a string but are trying to assign it a numerical value.



thanks, that helped!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1