Nice question , but very less guys think to that extend.
So to explain if we take an an string of char, and save some information in it, we don;t use & operator because string save only the information of the first address only and after that it is allocated in continuous manner . Hence if we can get the first address rest can be find by incrementing the address as per the variable declaration.
Secondly, the & operator is used to get the address of the variable and since string is collection of continuous memory location, we dont need the & operator.
the & operator points towards the address. when we declare the string by default the address of the first location is pointed unless we specify the position of char in a string.
Nice question , but very less guys think to that extend.
So to explain if we take an an string of char, and save some information in it, we don;t use & operator because string save only the information of the first address only and after that it is allocated in continuous manner . Hence if we can get the first address rest can be find by incrementing the address as per the variable declaration.
Secondly, the & operator is used to get the address of the variable and since string is collection of continuous memory location, we dont need the & operator.
Hope that help.
the & operator points towards the address. when we declare the string by default the address of the first location is pointed unless we specify the position of char in a string.
yeah, mr jaffar thats it ,but i want more comprehension.