Interview Question






Comment hidden because of low score. Click to expand.
0
of 0 vote

Doesn't the compiler allocate exactly 5 bytes for an A object?

- chennavarri October 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If you used the packed keyword, it will

- sid October 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

the size of this array will be 8 bytes instead of 5 because int needs to align into the memory at a location 4*n
Please google structure padding for more details.

- Anonymous October 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#pragma pack(push, 1)
struct A
{
char c;
double i;
char c1;
} ;
#pragma pack(pop)

- sparkagain October 29, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

SeX ques and Answer!!!

- Fcker_24X7 November 14, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

struct A
{
}__attribute__((packed));

- tyrone March 02, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

8 BYTE instnt of 5 BYTE.because memory block by struct a is 4 yte for both element.save this m/m space use pragma pack.

- Anonymous April 27, 2011 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More