Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4610292
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:06:38+00:00 2026-05-22T01:06:38+00:00

Looking to compare two BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH]; from the IP_ADAPTER_ADDRESSES Structure where byte is defined

  • 0

Looking to compare two

BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];

from the IP_ADAPTER_ADDRESSES Structure

where byte is defined in windows as typedef unsigned char BYTE;

Do I need to compare memory?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:06:39+00:00Added an answer on May 22, 2026 at 1:06 am

    Matteo beat me to it. His answer is correct. Unfortunately I could not comment directly on his post (I may be too new here), but I wanted to confirm his response since the majority of answers thus far are incorrect.

    The data type in question is an array of bytes.

    Do NOT use the equality operator (==) for comparing the values of two arrays, it will only evaluate to true if you’re comparing the same array to itself. Even if the byte arrays have the same values across each of their elements, yet are different arrays (and therefore reside at different places in memory), the equality operator will return false.

    In essence, an array is just a pointer in memory. Here are two ways to declare arrays:

        int * pointer = new int[5];
    

    or:

        int array[] = new int[5];
    

    You can access the first element with either:

        *pointer = 100;  // Dereference the pointer to get the int at that location
    

    or:

        array[0] = 100;
    

    You can even do:

        *array = 100;
    

    or:

        pointer[0] = 100;
    

    This should demonstrate that an ‘array’ is just a pointer to the first element of a block of contiguous memory. So, when comparing two arrays to eachother using the equality operator, it’s the same as comparing two pointers to eachother. To re-iterate the main point, if the arrays are not in the same space in memory, the pointers point to different places, and are therefore not ‘equal,’ at least in terms of the equality operator.

    I hope this is appropriate information for your skill level 🙂 If not, perhaps it will help someone else. Also, it’s been a while since I’ve had the pleasure of using C++, so hopefully everything is correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for performance efficient ways to compare two byte[] for equality. Sizes
I'm looking to compare two documents to determine what percentage of their text matches
I'm looking to compare two varchars in SQL, one would be something like Cafe
I am looking to compare two arrays in google test. In UnitTest++ this is
I'm looking to compare two sets and display the missing elements in second set
I need to very efficiently compare two maps in Clojure/Java, and return the difference
I am trying to compare two byte arrays in memory and produce a data
I'm looking for a concise way to compare two arrays for any match. I
I am looking to compare two exe files. I should ensure that the existing
I'm looking for the appropriate algorithm to use to compare two files. I think

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.