Short and to the point (Pointer ;-) Thank you! Your videos are true jewels!
@ProfessorHankStalica Жыл бұрын
Glad you like them!
@qcnck2776 Жыл бұрын
Thanks for a nice explanation of the pitfalls of 'delete'
@ProfessorHankStalica Жыл бұрын
You're welcome
@yazanallahham4813 Жыл бұрын
at minute 4:10, why does it return "talica" ? why does it not return the memory address of "t" in the array of characters ? I thought if we made return type char*, and put return p in the function, it should return the memory address. Pls clarify, thxxx very helpful tutorials
@ProfessorHankStalica Жыл бұрын
It does. cout starts displaying characters, one at a time, from the memory address you give it until it encounters the null terminator. So, in this case, we returned the memory address of the element containing t instead of the memory address of the element containing s.
@makaty98837 ай бұрын
thx for the valuable content!
@chiyang37498 ай бұрын
in cout, the ptr should print the memory address of that character, but why it print the actual character?
@mohamedboubakeur45547 ай бұрын
listen to what he said (3:44)
@liboyan7010 Жыл бұрын
good to know, thanks a lot!!!
@ProfessorHankStalica Жыл бұрын
Happy to help!
@sameaspastmueed Жыл бұрын
Why did we return nullptr when pointer p points at element which is storing null terminator . Is there a relation between nullptr and null terminator ?
@sameaspastmueed Жыл бұрын
Please this is confusing
@sameaspastmueed Жыл бұрын
Also, when the returned pointer to local variable my second cout statement remain the same even after the bar function was called . I beleive when i cout *p I should have gotten ! But instead I got the same value which was A. Why did this happen?
@ProfessorHankStalica Жыл бұрын
the function is returning a memory address of the element containing the target character or it is going to return nullptr. nullptr is designed for use with pointers and null terminator is a special character used with strings. Learn more: kzbin.info/www/bejne/a569aK1qo5WYgdU kzbin.info/www/bejne/a5-Zk4Zjm8Z6aqc
@ProfessorHankStalica Жыл бұрын
That's explained in the video: kzbin.info/www/bejne/iYvSpqVrdtRmfNk