473,406 Members | 2,378 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,406 software developers and data experts.

error that i cant quite understand,leave alone debug

i am using

Expand|Select|Wrap|Line Numbers
  1. vector< pair<string,double> > v;
  2.  
  3. string k = function_coded(v);
  4.  
  5. where ,
  6.  
  7. string function_coded(vector< pair<string,double> > v )
  8. {
  9.  //do something 
  10. }
  11.  
but while complilling i get the following error,please help .

error: conversion from ‘std::vector<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double>, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double> > >’ to non-scalar type ‘std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >’ requested
Mar 4 '08 #1
5 1670
hsn
237 100+
i never used vector <pair ....>
does that even work...????????????????????????

tell me
Mar 4 '08 #2
Banfa
9,065 Expert Mod 8TB
hsn vector< pair< ... > > should be fine.

eternalLearner, the code you have posted compiles fine for me without errors (VS 2005). I suggest that either you have not posted what is actually in your code or you have posted the wrong piece.
Mar 4 '08 #3
weaknessforcats
9,208 Expert Mod 8TB
i never used vector <pair ....>
does that even work...????????????????????????
Yes it does. The pair<> is an STL cointainer that has two public data members named first and second. Pair objects are used by other containers, like map, where the key is first and the value for the key is second.
Mar 4 '08 #4
i never used vector <pair ....>
does that even work...????????????????????????

tell me
ya that does work . :)
Mar 4 '08 #5
hsn vector< pair< ... > > should be fine.

eternalLearner, the code you have posted compiles fine for me without errors (VS 2005). I suggest that either you have not posted what is actually in your code or you have posted the wrong piece.
Hmm,i did not post the incorrect code,but the peoblem got solved wen i declared the function_coded(vect...) in the header file as extern,though i dont quite understand why it was so .

Thanks you to all. :)
Mar 4 '08 #6

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

Similar topics

17
by: Christopher Benson-Manica | last post by:
All right, since my previous idea (calling functions through a wrapper) was apparently so awful no one could suggest any improvements, I'll try a different tack. My end goal is to make detecting...
2
by: Steve Richfield | last post by:
My error handler works GREAT. However, VBA seems to have some bugs/features that are causing it fits. The little snippet that I put at the end of each routine looks like this: Error_Handler: If...
2
by: John Spiegel | last post by:
Hi all, I'm working through examples on configuring ASP.NET (all on local machine). The first exercise deals with the customErrors in the config files. The machine.config file has a...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
2
by: badboybrown | last post by:
Hello folks, I found this piece of code on this group by Dorman Blackman: > Function BusinessDays(dDate1, dDate2) As Long > BusinessDays = (DateDiff("d", dDate1, dDate2) - _ > ...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
16
by: lawrence k | last post by:
I've made it habit to check all returns in my code, and usually, on most projects, I'll have an error function that reports error messages to some central location. I recently worked on a project...
3
by: Daniel | last post by:
LoaderLock was detected Message: DLL 'C:\WINDOWS\assembly\GAC\Microsoft.DirectX.Direct3D\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.Direct3D.dll' is attempting managed execution inside OS...
9
by: simple12 | last post by:
Hello I have a script which have the facility of entering any code to some part of a webpage. I have some problems with it. When i put some code in the script then their is no error shown. When i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.