473,382 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Error in STL CONTAINERS URGENT PLZ

hi i am using ms visualstudio 6.0 and i am getting error like

1. push_back' : cannot convert parameter 1 from 'char' to 'const struct struEventList &'
Reason: cannot convert from 'char' to 'const struct struEventList'
No constructor could take the source type, or constructor overload resolution was ambiguous

2. binary '=' : no operator defined which takes a right-hand operand of type 'class std::list<class CDataFrame,class std::allocator<class CDataFrame> >' (or there is no acceptable conversion)


the code would like .

void CWanNetwork ::m_fnFormEventList(char cStateType,long double ldTimer1,char cDevType,short snDevId,char cDevPortId,char cIsError)
{
//changint to implement the STL LIST
list<struEventList> pstruTemp;

list<struEventList>::iterator pstruLocal = pstruTemp.begin();


EVENTLIST* pstruLocl = NULL;


pstruTemp.push_back(cDevType);

pstruTemp.push_back(cStateType);

pstruTemp.push_back(cDevPortId);

pstruTemp.push_back(snDevId);

pstruTemp.push_back(ldTimer1);


pstruTemp.push_back(cIsError);

list<EVENTLIST> pstruHead; //2nd container for pstruHead

//if(pstruHead == NULL)
if(pstruHead.begin() == NULL)
{//1
//pstruHead = pstruTemp;
copy( pstruTemp.begin(),pstruTemp.end(),pstruHead) ; //this will copy the contents to head
}//1 if
else
{
// Assign the Head pointer to the local variable
//pstruTemp1 = pstruHead;
copy(pstruHead.begin(),pstruHead.end(),pstruTemp1) ;
list<EVENTLIST> pstruTemp1;
list<EVENTLIST>::iterator Temp1itr = pstruTemp1.begin();
while(pstruTemp1.begin()!=NULL)
{//while
//if(pstruTemp1->ldTimer1<=ldTimer1)//raj
if(Temp1itr->ldTimer1<=ldTimer1) //check with the container value
{//2
/ Store the previous pointers
/ pstruLocl = pstruTemp1;
copy(pstruTemp1.begin(),pstruTemp1.end(),pstruLocl );
Oct 18 '06 #1
1 1407
dtimes6
73
[quote=vinothsec]hi i am using ms visualstudio 6.0 and i am getting error like

1. push_back' : cannot convert parameter 1 from 'char' to 'const struct struEventList &'
Reason: cannot convert from 'char' to 'const struct struEventList'
No constructor could take the source type, or constructor overload resolution was ambiguous

it says it can not convert char to const struct struEventList &, can you provide code for struEventList ? It seems there is no way or at least two way of convert char to const struct struEventList &.

2. binary '=' : no operator defined which takes a right-hand operand of type 'class std::list<class CDataFrame,class std::allocator<class CDataFrame> >' (or there is no acceptable conversion)

you have to provide a copy constructor and a copy operator for your CDataFrame stl need to use these things.
Oct 18 '06 #2

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

Similar topics

6
by: Cormac | last post by:
Hi everyone, I'm writing Pure Data externals in C++ using Ms Visual C++ 7.0 and Windows2000. I'm running motions sensor hardware so there's a bit of real time data processing involved. When...
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
0
by: Lan W via DBMonster.com | last post by:
I tried to restore DB2 UDB two databases into two different instances on AIX server. the raw devices size of rShortSpace0 and rShortSpace1 on the two instances are the same. # lsvg -l datavg...
6
by: Jurgen Haan | last post by:
Hi hi, I'm trying to perform a redirected restore, but I get a nice error returned. Does anyone have an idea of what the -5130 errorcode means? db2inst@ELMO:~> db2 restore db efproddb into...
18
by: imutate | last post by:
I have an integer variable and I am testing it as follows #define NULL_VAL -1 ... if (x.id != NULL_VAL) { std::cout << x.id << std::endl; ... }
22
by: =?gb2312?B?wNbA1rTzzOzKpg==?= | last post by:
windows xp, visual studio 2005 ---------------------------------------------------------------------------------------------------------------------------------- #include <iostream> #include <map>...
0
by: Lysander | last post by:
Thought I would give something back with a few articles. This article is a bit of code to add error handling. When I have time, I want to write articles on multilingual databases, and Access...
1
by: psantosh12 | last post by:
Hello Frnds Please need help to resolve error.......... it is very very urgent........ The error is Runtime Error Description: An application error occurred on the server. The current custom...
7
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am using this code to get groups for a user and getting a error (5) on the GetAuthorizationGroups() function . There are two domains. This function works on the local domain but does not work...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.