473,566 Members | 3,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to fix "C2679: binary '>>' : no operator found" error?

2 New Member
Error 1 error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     string lastName1, firstName1, lastName2, firstName2, lastName3, firstName3;
  9.     double currentSalary1, currentSalary2, currentSalary3;
  10.     double percentPayIncrease1, percentPayIncrease2, percentPayIncrease3;
  11.     double updatedSalary1, updatedSalary2, updatedSalary3; 
  12.  
  13.     ifstream fin;
  14.     ofstream fout;
  15.  
  16.     fin.open("Ch3_Ex8Data.txt");
  17.     fout.open("Ch3_Ex8Output.txt");
  18.  
  19.     fin >> lastName1 >> firstName1 >> currentSalary1 >> percentPayIncrease1;
  20.     fin >> lastName2 >> firstName2 >> currentSalary2 >> percentPayIncrease2;
  21.     fin >> lastName3 >> firstName3 >> currentSalary3 >> percentPayIncrease3;
  22.  
  23.     updatedSalary1 = currentSalary1 * percentPayIncrease1 + currentSalary1;
  24.     updatedSalary2 = currentSalary2 * percentPayIncrease2 + currentSalary2;
  25.     updatedSalary3 = currentSalary3 * percentPayIncrease3 + currentSalary3;
  26.  
  27.     fout << firstName1 << lastName1 << updatedSalary1;
  28.     fout << firstName2 << lastName2 << updatedSalary2;
  29.     fout << firstName3 << lastName3 << updatedSalary3;
  30.  
  31.     fin.close();
  32.     fout.close();
  33.  
  34. return 0;
  35. }
Feb 6 '11 #1
1 2770
horace1
1,510 Recognized Expert Top Contributor
try adding
Expand|Select|Wrap|Line Numbers
  1. #include <string>
  2.  
otherwise what line is the error on?
Feb 6 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1992
by: IMS.Rushikesh | last post by:
Hi Friends, My work is stuck up because of this unresolvable and unbelievable Error. I'm trying to Serialize my Class object using XmlSerialization. And at below line, I m getting "error File or assembly name xxxxxxx.dll, or one of its dependencies, was not found.." ///I got error at this point
8
9995
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebApplication1'. 'HTTP/1.1 500...
5
9108
by: Archana | last post by:
Hi all, I am having application where i am downloading xml content using webrequest. my code is as below HttpWebRequest lWebRequest = (HttpWebRequest) WebRequest.Create(URL); HttpWebResponse lWebResponse = (HttpWebResponse) lWebRequest.GetResponse(); StreamReader lResponseStream = new...
1
2501
by: jonny | last post by:
Went from using Visual Web Develop express to Visual Studio 2005 and getting error when trying to open project. Error message: "One or more projects in the solution could not be loaded for the following reason(s): The project file or web has been moved, renamed or is not on your computer.
21
3810
vikas251074
by: vikas251074 | last post by:
I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support this property or method'. <form name="myform" action="main.asp" method="post"> <div id="content"> <h2 id="pageName">Main Page</h2> <div...
2
2778
by: sony.m.2007 | last post by:
Hi, When i try to set a value for a session variable I'm getting a object refence not set error I tried two methods as below HttpContext.Current.Session.Add("AppStartTime", DateTime.Now); HttpContext.Current.Session = DateTime.Now; For the above two methods I'm getting error as "Object reference not set to an instance of an object."
4
4011
by: sumit kale | last post by:
Hi, Can somebody help me resolve my problem ? I am getting error when calculating total using unbound textfiled in subform. I have a main form called purchase_register_master and a subform called purchase_register_details, In sub form i have a unbound textfield called txt_Total_Amount where in i am calculating total amount for different...
12
6806
by: tvnaidu | last post by:
Trying to mount windows folder on Linux machine, getting this error. I have a folder called "CheckIn" on windows, I made that folder as Network sharing. ON lInux, I tried to access that folder by mounting, getting error "Could not resolve mount point". # mkdir /mnt/winstuff # smbmount \\windows-machine-ip-addr\CheckIn Could not resolve...
2
3204
by: bandy | last post by:
Hi there sorry If I posted this thread under wrong head. When I am trying to run my site I am getting error as Internal Server Error, but when I refresh page , i get result properly. I don't know why this is so? Detailed error is like: Internal Server Error The server encountered an internal error or misconfiguration and was unable...
1
1542
by: NareshN | last post by:
Hi, I am getting error in following stored procedure in where condition Must declare the scalar variable "@CampaignId".I already declared CampaignId but still getting error.Please see where condition which is in bold letters. If i give value its working like where CampaignID=1 alter PROCEDURE SAR_Sp_GetForecastedHC(@date1 DATETIME,...
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8109
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.