Hi,
I wonder what's wrong with the following,
std::vector<pair<int, int>> myVec;
The compiler always complains that "expect , instead of >>".
Thanks. 5 3668
On Thu, 20 Nov 2003 17:40:06 -0700, Jee <je*@hotmail.com> wrote: Hi, I wonder what's wrong with the following,
std::vector<pair<int, int>> myVec;
The compiler always complains that "expect , instead of >>".
">>" is the right shift operator, you need to use:
std::vector<pair<int, int> > MyVec;
And std::pair would make more sense since you are suing std::vector...
--
Sam Holden
Same error after I change it to
std::vector<std::pair<int, int>> myVec;
Any idea?
Jee wrote: Hi, I wonder what's wrong with the following,
std::vector<pair<int, int>> myVec;
The compiler always complains that "expect , instead of >>".
Thanks.
--
_ Hi, this is Je*@hotmail.com _
Jee wrote: Same error after I change it to
std::vector<std::pair<int, int>> myVec;
Any idea? ...
Read Sam's reply again. He already answered your question.
--
Best regards,
Andrey Tarasevich
"Jee" <je*@hotmail.com> wrote in message
news:3F***************@hotmail.com... Same error after I change it to
std::vector<std::pair<int, int>> myVec;
Any idea?
Read Sam's reply again, carefully. is an operator, so that's what the compiler sees it as.
std::vector<std::pair<int,int> > myVec;
^^^
-Mike
On Thu, 20 Nov 2003 18:07:59 -0700, Jee wrote: Same error after I change it to
std::vector<std::pair<int, int>> myVec;
Any idea?
Jee wrote:
...
It is very simple.
You MUST have a space between th two '>' characters at the end of the
statement. Without the space, the compiler thinks it is a shift operator.
The statement You would should look like this :
std::vector<std::pair<int, int> > my Vec ;
Note the Space between the two '>' This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Honestmath |
last post by:
Hi,
I added the following line to my code within a class declaration:
std::vector<Date> m_duedates(100);
I also tried:
std::vector<Date> m_duedates(100, Date());
|
by: John |
last post by:
I have a function declaration that gives an error while compiling.
Can anyone help me figure this one out?
inline void create(const std::vector< myclass >& plist,
std::vector< myclass...
|
by: Lovens Weche |
last post by:
I'm trying to compile this code with VC++ 7:
class KeyboardInterface
{
public:
.....
|
by: Michael Sgier |
last post by:
Hello
If someone could explain the code below to me would be great.
// return angle between two vectors
const float inline Angle(const CVector& normal) const
{
return acosf(*this % normal);
}...
|
by: Daniel J Watkins |
last post by:
Hi,
Some runtime memory exceptions are being exhibited with some code I've
written. Can you clarify the following with you to see if my understanding
of the principles under question are...
|
by: gamehack |
last post by:
Hi all,
Here's the error which I'm getting when trying to compile some code:
boxmanager.h:16: error: ISO C++ forbids declaration of 'vector'
with no type
boxmanager.h:16: error: expected...
|
by: y-man |
last post by:
Hi,
I am creating a child class of the vector, which contains a couple of
functions to make the work with carthesian coordinate vectors easier.
To make things work more easily, I would like to...
|
by: kungfuelmosan |
last post by:
Hey guys, Im just getting into c++ at the moment so please bare with
me
Basically i need to declare a vector<stringstringArray(50)
inside a class, however by doing so i am getting the following...
|
by: subramanian100in |
last post by:
I am copying the following text as it is from Stroustrup's TC++PL 3rd
edition, page 450.
It says:
"Note that a constructor given two arguments of the same type can be a
match for more than...
|
by: samsneelam |
last post by:
Hi..
This is samuel, while doing a program, i encountered this problem.. Let me give you clarity regarding my prob..
I am having two files .. one is mpcplib.h it contains the follwing...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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,...
| |