What is Memory Alignment?

Answers were Sorted based on User's Feedback



What is Memory Alignment?..

Answer / sv

Memory alignment is the restriction imposed on memory
allocation in such a way that values associated with
multibyte get assigned only at certain places of memory.
Such Memory alignment though generally not very common
issue in OOPS terminology as the compiler takes care of
allocation of bytes at proper locations.

Is This Answer Correct ?    15 Yes 1 No

What is Memory Alignment?..

Answer / achal ubbott

Above is correct. E.g. an ARM processor stores an integer(4
bytes wide) at an address which is multiple of 4 only. So
an integer would not be stored at say 0x0009 address.

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More C++ General Interview Questions

How are Structure passing and returning implemented by the compiler?

0 Answers  


What are the various operations performed on stack?

0 Answers  


class X { private: int a; protected: X(){cout<<"X constructor was called"<<endl;} ~X(){cout<<"X destructor was called"<<endl} }; Referring to the code above, which one of the following statements regarding "X" is TRUE? a) X is an abstract class. b) Only subclasses of X may create X objects. c) Instances of X cannot be created. d) X objects can only be created using the default copy constructor. e) Only friends can create instances of X objects.

2 Answers   Quark,


Can we use resume in error handling i.e. in the catch block

5 Answers   Infosys,


find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

0 Answers  






Is c++ used anymore?

0 Answers  


Which function should be used to free the memory allocated by calloc()?

0 Answers  


What is Memory Alignment?

2 Answers   TCS,


class HasStatic { static int I; }; Referring to the sample code above, what is the appropriate method of defining the member variable "I", and assigning it the value 10, outside of the class declaration? a) HasStatic I = 10; b) int static I = 10; c) static I(10); d) static I = 10; e) int HasStatic::I = 10;

1 Answers   Quark,


Is c++ still being used?

0 Answers  


. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?

0 Answers  


Which operator cannot be overloaded c++?

0 Answers  


Categories