DaniWeb Programming
and Web Development Community
Loading
Home
Recent Posts
Revenue Sharing
Register
Contact Us
Login
Username
Password
Forgot your password?
|
Register
Welcome to TechnicalTalk.Net forum!
It seems that you are not a member yet. To interact with other members and to post on the forum.
Get a free account now
Earn money on this forum
Advertise with us...
TechnicalTalk
»
Programming and Web Development
»
C/C++
»
Error C2676
Quick Links:
Want to earn money on forum? visit -->
Earn money on forum
Add to Reputation:
Reputation
What do you think of this post?
I agree
I disagree
Comment:
Pages: [
1
]
Go Down
Email this topic
|
Print
0 Members and 2 Guests are viewing this topic.
Error C2676
Name_changed
Reputation Power: 1
New Poster
Posts: 3
Topics: 3
Error C2676
August 07, 2008, 02:36:52 PM
On my C++ program, I have a C2676 error. I am not quite sure how to fix it. The error says that : "binary '*' : 'std::_Vector_iterator<_Ty,_Alloc>' does not define this operator or a conversion to a type acceptable to the predefined operator."
Please help. Thanks,
TechnicalTalk1905.
P.S, here is the file. There is a lot more to this project, but I am just posting the part I have the problem in.
#include "stdafx.h"
#include "HelloMFC1.h"
#include "TestDlg.h"
#include "MiscDLG.h"
#include "MathDLG.h"
#include "HealthDLG.h"
#include <Math.h>
#include <vector>
using namespace std;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
void CTestDlg::OnBnClickedEqual()
CString test;
int N, i, N1, flag;
double res, tmp, tmp1;
vector<CString> inputs;
std::vector<int> optor;
vector<CString>::iterator inputmp;
vector<int>::iterator optormp;
inputs.push_back("2");
inputs.push_back("3");
inputs.push_back("5");
inputs.push_back("2");
optor.push_back(1);
optor.push_back(3);
optor.push_back(3);
optor.push_back(5);
N = inputs.size();
N1 = optor.size();
flag =1;
if (N == N1)
{
while (flag >0)
{
N = inputs.size();
N1 = optor.size();
inputmp = inputs.begin();
optormp = optor.begin();
for(i = 0; i<N; i++)
{
if (optor
==5)
{
tmp = atof(inputs
);
tmp1 = sqrt(tmp);
test.Format("%.6f", tmp1);
inputs
= test;
optor.erase(optormp);
break;
}
else if(optor
==3)
{
tmp = atof(inputs
);
tmp1 = inputmp * (tmp); //Right Here is the C2676 error
test.Format("%.6", tmp1);
inputs
= test;
inputs.erase(inputmp);
optor.erase(optormp);
break;
}
test = *inputmp;
optormp++;
inputmp++;
}
if (N1==1)
{
flag =0;
}
}
res
ManicQin
Reputation Power: 1
New Poster
Posts: 3
Topics: 1
Re: Error C2676
August 16, 2008, 11:36:32 PM
Quote from: Name_changed on August 07, 2008, 02:36:52 PM
tmp1 = inputmp * (tmp); //Right Here is the C2676 error
You need to Dereference the iterator inputmp
i.e. tmp1 = (*inputmp) * tmp;
Email this topic
|
Print
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
Technical Resources - Articles and Videos
-----------------------------
=> Read/Post Free Articles
===> SEO and Marketing
===> Graphics and Design
===> Operating Systems
===> Programming
===> Gadget and Product Review
=> Video Tutorials
-----------------------------
Programming and Web Development
-----------------------------
=> C/C++
=> Visual Basic 6.0
=> Classic ASP 3.0
=> .NET
=> PHP
=> JAVA
=> Python
=> JavaScript and VBScript - Scripting Languages
=> Web Security
=> Other programming languages
=> Database Programming Discussions
===> Microsoft SQL Server
===> My SQL
-----------------------------
Graphics and Web Design
-----------------------------
=> HTML/XHTML/DHTML & CSS
=> Photoshop and Flash
=> General Web Design
=> Review your website or blog
-----------------------------
Operating Systems
-----------------------------
=> Windows
=> Linux and Unix
=> General - Operating System Discussion
-----------------------------
SEO and Marketing Success Strategy
-----------------------------
=> Search Engines
===> Google
===> Yahoo
===> Microsoft Bing
=> SEO - Search Engine Optimization
===> Web Directories
===> Link Development
=> Internet Marketing and Advertising
===> Affiliate Programs
===> Generating Revenue
===> Increasing Traffic
=> General Marketing Discussion
=> Promote Your Service
-----------------------------
Web Hosting and Hosting Management
-----------------------------
=> Web Hosting Talk
=> Web Hosting offers and plans
-----------------------------
Miscellaneous
-----------------------------
=> Blogging - Blogger's Paradise
=> Social Networks
=> Tips and Tricks
=> Chit Chat - Non Programming
-----------------------------
Forum Information
-----------------------------
=> Introduce Yourself
=> Suggestions and Feedback
=> Forum Rules/Guidelines/News/Announcements
=> Forum Support
=> Forum Games and Contests
===> Games
Home
|
Advertise
|
Forum Help
|
Privacy Policy
|
Contact us
Powered by SMF 1.1.16
|
SMF © 2011, Simple Machines
Google visited last this page April 16, 2012, 09:39:23 PM
Loading...