473,503 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to check and comapre content of two structures

3 New Member
How can we check whether the contents of two structure variables are same or not?

What is the difference between an enumeration and a set of pre-processor # defines?

What is the maximum combined length of command line arguments including the space between adjacent arguments?
Sep 9 '07 #1
4 1773
Banfa
9,065 Recognized Expert Moderator Expert
How can we check whether the contents of two structure variables are same or not?
You compare all the members of the structures. If you try to use something like the memcmp function you will run into trouble because the could be padding in the structure and although the members are the same the structure padding could contain different values effects the comparison result.

If you are using C++ overload operator = for the structure to do a comparison for you allowing you to use == in you code.

What is the difference between an enumeration and a set of pre-processor # defines?
What do you think the differences are?

What is the maximum combined length of command line arguments including the space between adjacent arguments?
It is platform dependent.
Sep 9 '07 #2
weaknessforcats
9,208 Recognized Expert Moderator Expert
If you are using C++ overload operator = for the structure to do a comparison
Typo. He means you should overload operator==.
Sep 9 '07 #3
kreagan
153 New Member
What is the difference between an enumeration and a set of pre-processor # defines?
pre-processor = string substitution during compile time.
enumeration = counting. (I would suggest reading more about enumeration).
Sep 9 '07 #4
weaknessforcats
9,208 Recognized Expert Moderator Expert
pre-processor = string substitution during compile time.
enumeration = counting. (I would suggest reading more about enumeration).
Close.

preprocessor -> substitution before the compile starts. Compiler cannot check validity of the expansion.

enumeration -> named integer values. It's a bigger area then just counting. enums are part of C/C++ and the compiler can check for correct usage and value.
Sep 10 '07 #5

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

Similar topics

9
2610
by: Stanimir Stamenkov | last post by:
Looking through the draft I still can't figure out how one could (is it possible to) group several elements and style a generated containing block for the group. This is much similar to a typical...
3
1523
by: Jérôme de Lagausie | last post by:
Hello, In one hand, I've got a set of more than 130 different structures, mostly rather simple (a set of simple data members such as int, long, char , float ...) sample : #ifndef _H2_H_...
4
6655
by: VR | last post by:
I am trying to embed a check box into a FlexGrid's cell, but having a problem when I start scrolling the grid. Here is my MyCheckBox class... class MyCheckBox : CheckBox { void Init (...
11
7960
by: zhong | last post by:
Error Message: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention...
3
1937
by: TK | last post by:
Excuse me for multiple posting because I've posted this message to aspnet.security NG but have not got any response yet. I'm building an ASP.NET application works in Forms Authentication mode...
2
2906
by: Chad | last post by:
I have a textbox control, txtMeasurement, that I want to allow only numeric decimal input. I thought to use a client side validation control to ensure that the data entered is of type "Double". ...
12
11508
by: Dave H. | last post by:
Please redirect me if this message is posted to the wrong group. Given the intention of delivering content to an HTTP user agent (such as Internet Explorer) which is to be immediately opened by...
2
1954
by: Andreas Lundgren | last post by:
Hi! I want to put some values in static memory, and then be able to reference this data from my code in a decent way by referencing AllData.Data. (All code beneth is placed outside functions.) ...
6
2306
by: vijayarl | last post by:
hi all, i am reading the content of the directory & then putting if condition to comapre the file name. problem is: filename ends with number. eg :prstat-Lvs-20080118-2100 the first part...
0
7205
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
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7348
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...
1
7006
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
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5021
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...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.