I just started mess with Memory at c++ so i am very confused now, and this is why i am asking 3 questions that made me confuse so much.
1. Look at this:
char *str = "Literal String";
Here we are creating a char pointer called str then we are giving to some CELLS in memory this values "Literal String" and setting str to point on the first element at this memory block.
so it means that this expression "Literal String" returns an address of the first element in this memory block to str everywhere??
or its just in char pointers case??
2.
and what is going on here?
char x = 's';
We are giving to some CELL in memory a name X and then we are giving to this CELL the value 's'??
Or we are giving to some CELL in memory a name X then we are giving to some CELL this value 's' and then we are copying the value 's' from this CELL to the CELL X??
What is the correct answer here??
3.
And what is this?
void main()
{
"Literal String";
}
Here we are just giving to some CELLS in memory this values "Literal String" ???
and thats all??
I very need answers to this questions because when i started mess with memory its made me very very confused and i cant understand a thing now :'(.