[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

3.8

(MS VC++) Could you explain this to me ?

Asked by andrey_2007 in Miscellaneous Programming

Tags: access, violation, what

------------| MS VC++ Code |--------------------

typedef union
{
      int            i;
      char            c;
      short            t;
} MY_UNION;

namespace SOME_SPACE { static MY_UNION uni; };

#define MY_TYPE(s,m)   SetType(((s *)&SOME_SPACE::uni)->m)

int SetType(int nValue)
{
  return 5;
}

typedef struct
{
                int                        count1;
      char                        Buffer1[257];
      char                        Buffer2[257];
      char                        Buffer3[257];
      char                        Buffer4[257];
      char                        Buffer5[257];
      char                        Buffer6[257];
      char                        Buffer7[257];
      char                        Buffer8[257];
      char                        Buffer9[257];
      char                        Buffer10[257];
      char                        Buffer11[257];
      char                        Buffer12[257];
      char                        Buffer13[257];
      char                        Buffer14[257];
      char                        Buffer15[257];
      char                        Buffer16[257];
      char                        Buffer17[257];
      char                        Buffer18[257];
      char                        Buffer19[257];
      char                        Buffer20[257];
      char                        Buffer21[257];
      char                        Buffer22[257];
      char                        Buffer23[257];
      char                        Buffer24[257];
      char                        Buffer25[257];
      char                        Buffer26[257];
      char                        Buffer27[257];
      char                        Buffer28[257];
      char                        Buffer29[257];
      char                        Buffer30[257];
      char                        Buffer31[257];
      char                        Buffer32[257];
      char                        Buffer33[257];
      char                        Buffer34[257];
      char                        Buffer35[257];
      char                        Buffer36[257];
      char                        Buffer37[257];
      char                        Buffer38[257];
      char                        Buffer39[257];
      char                        Buffer40[257];
      char                        Buffer41[257];
      char                        Buffer42[257];
      char                        Buffer43[257];
      char                        Buffer44[257];
      char                        Buffer45[257];
      char                        Buffer46[257];
      char                        Buffer47[257];
      char                        Buffer48[257];
      char                        Buffer49[257];
      char                        Buffer50[257];
      char                        Buffer51[257];
      char                        Buffer52[257];
      char                        Buffer53[257];
      char                        Buffer54[257];
      char                        Buffer55[257];
      char                        Buffer56[257];
      char                        Buffer57[257];
      char                        Buffer58[257];
      char                        Buffer59[257];
      char                        Buffer60[257];
      char                        Buffer61[257];
      char                        Buffer62[257];
      char                        Buffer63[257];
      char                        Buffer64[257];
      char                        Buffer65[257];
      char                        Buffer66[257];
      char                        Buffer67[257];
      char                        Buffer68[257];
      char                        Buffer69[257];
      char                        Buffer70[257];
      char                        Buffer71[257];
                int                        mode;

} BIG_STRUCT;


void main()
{

      int res = MY_TYPE(BIG_STRUCT, mode);

}


---------------------End of Code---------------------------


Could you explain the following to me:

If BIG_STRUCT is as big as it is shown above, the program causes an exception (Access Violation).

If we have the BIG_STRUCT structure a few character strings shorter (Buffer strings 67-71 are commented out), the program works fine.  Whats going on?


-andrey
[+][-]08/01/04 03:22 AM, ID: 11687294Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 09:17 AM, ID: 11688461Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/04 11:25 AM, ID: 11689051Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 12:42 PM, ID: 11689274Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/04 12:49 PM, ID: 11689285Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/04 01:11 PM, ID: 11689340Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 01:31 PM, ID: 11689388Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/04 02:46 PM, ID: 11689610Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Miscellaneous Programming
Tags: access, violation, what
Sign Up Now!
Solution Provided By: rpz
Participating Experts: 4
Solution Grade: A
 
[+][-]08/01/04 02:52 PM, ID: 11689628Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 03:31 PM, ID: 11689740Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/04 04:07 PM, ID: 11689857Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 04:58 PM, ID: 11690073Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/04 05:12 PM, ID: 11690116Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 05:22 PM, ID: 11690143Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 05:37 PM, ID: 11690172Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/04 05:40 PM, ID: 11690179Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 05:48 PM, ID: 11690198Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 06:01 PM, ID: 11690241Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/04 06:02 PM, ID: 11690245Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 06:04 PM, ID: 11690247Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 06:07 PM, ID: 11690254Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/04 10:27 PM, ID: 11691012Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08/01/04 10:38 PM, ID: 11691034Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 10:39 PM, ID: 11691039Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 10:39 PM, ID: 11691040Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/04 10:56 PM, ID: 11691095Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/02/04 04:34 AM, ID: 11692584Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/03/04 06:45 AM, ID: 11704324Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08/04/04 04:43 AM, ID: 11714253Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/04/04 05:21 AM, ID: 11714529Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08/04/04 06:22 PM, ID: 11722540Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/04/04 06:45 PM, ID: 11722622Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/05/04 12:14 PM, ID: 11729710Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/27/04 06:50 AM, ID: 11913069Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]08/27/04 01:52 PM, ID: 11917550Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/29/04 05:33 AM, ID: 11925351Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/04 02:24 PM, ID: 11946816Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89