i have two hashes (maps)
map <int, int> FAULTFREENETS;
map <int, int> FAULTNETS;
is there a way i can check if FAULTFREENETS = FAULTNETS with just one
statement instead of writing a for loop with iterators, etc. ?
(just trying to reduce code clutter) 6 2297
mahur...@gmail.com wrote: i have two hashes (maps)
map <int, int> FAULTFREENETS; map <int, int> FAULTNETS;
is there a way i can check if FAULTFREENETS = FAULTNETS with just one
Don't use all-caps for variable names. Reserve that for macros.
statement instead of writing a for loop with iterators, etc. ?
(just trying to reduce code clutter)
Lookup std::equal() from <algorithm> or roll-up your own function and
call it.
Jonathan ma******@gmail.com wrote: i have two hashes (maps)
map <int, int> FAULTFREENETS; map <int, int> FAULTNETS;
is there a way i can check if FAULTFREENETS = FAULTNETS with just one statement instead of writing a for loop with iterators, etc. ?
(just trying to reduce code clutter)
Of course, the obvious works
if (FAULTFREENETS == FAULTNETS)
{
cout << "they're equal\n";
}
john
John Harrison wrote: ma******@gmail.com wrote: i have two hashes (maps)
map <int, int> FAULTFREENETS; map <int, int> FAULTNETS;
is there a way i can check if FAULTFREENETS = FAULTNETS with just one statement instead of writing a for loop with iterators, etc. ?
(just trying to reduce code clutter)
Of course, the obvious works
if (FAULTFREENETS == FAULTNETS) { cout << "they're equal\n"; }
I just hate when this happens.
Jonathan
perfectamundo. "=" works like a charm. ma******@gmail.com wrote: i have two hashes (maps)
map <int, int> FAULTFREENETS; map <int, int> FAULTNETS;
If this is std::map, then just use operator ==. But they are not hash maps.
--
Valentin Samko - http://www.valentinsamko.com ma******@gmail.com wrote: perfectamundo. "=" works like a charm.
That should be ==, not =.
Jonathan This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dan Stromberg |
last post by:
We will soon have 3 copies, for testing purposes, of what should be about
4.5 terrabytes of data.
Rather than cmp'ing twice, to verify data integrity, I was thinking we
could speed up the...
|
by: ArunPrakash |
last post by:
Hi,
I have 2 tables and each has a text column. When i compared the 2
columns with the LIKE operator i found something strange.
create table test1( var1 text )
create table test2( var1 text )
...
|
by: Jeff Thies |
last post by:
I need to check if two hashes are identical.
My thoughts are something like this:
function compareHash(hash1,hash2){
if(hash1.length != hash2.length){return false}
for(var key in hash1){...
|
by: Peter |
last post by:
Hi
how can I compare two byte arrays in VB.NET
Thank
Peter
|
by: Iain |
last post by:
Hi
Hopefully I am missing something really simple with this question, but
here goes.
I have two Bitarrays that I would like to compare. At the moment, I am
XORing one with the other and...
|
by: Ole Nielsby |
last post by:
How does the GetHashCode() of an array object behave?
Does it combine the GetHashCode() of its elements, or does
it create a sync block for the object?
I want to use readonly arrays as...
|
by: kj7ny |
last post by:
I am attempting to incrementally back up files using python. How can I
compare a file on a hard drive to a file in a python created zip file
to tell if the file has changed? Or should I be using...
|
by: danielle.m.manning |
last post by:
Can someone help me figure out what is the best way to perform this
task?
I have to detect if there were any changes from one recordset to
another. My recordset consists of a key (guid), and...
|
by: subodheee |
last post by:
i have a problem in implementing script,i have to extract from below data op,offset,and i need to compare the if same offset,same op repeats in other process i need to make it as same,else no .please...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
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...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |