1] In pointer case , as Hello has 5 words thus 5 byte of memory is consumed to store it .
and each byte will have its different memory address , each incremented by one from the previous one .Here *str is a
pointer to character which will point to 'H' of hello . In other words *str holds address of 'H' . It is important to note that str is a pointer and it can point to only one address at a time , and thus it points to'H' not to Hello .
whereas arr[] is a array . it is like name provided to the characters as a[0] ='H' , a[1]=e and so on ..
What the main difference comes is in pointer characters where accessed by their address whereas in they are accessed by their variable name . if you want detailed information on function working ,
click it and
click it if you want detailed information on arrays .
2]
C Structure :-
1. Only variables of different data types can be declared, functions are not allowed
2. Direct access to data members is possible
3. ‘struct’ data type is not treated as built in type – use of ‘struct’ necessary to declare
objects
4. Member variables cannot be initialized inside a structure.
struct tag
{
member 1 declaration;
member 2 declaration;
...
...
member m declaration;
};
C++ Structure :-
1. In C++ structure declaration functions can also be declared
2. The members declared in a C++ structure is public by default
3. While declaring an object the keyword ‘struct’ is omitted in C++