Why most of the variables in mystrtok function are pointer variables instead of normal variables
Why all pointer variables in function
hi @numanshaikh25 ,
its just the way he implemented it, the same work can be done in different way also
I am asking that why was it necessary to use pointers and what would have happened if instead normal variables would have been used in the parameters and the function name itself is a pointer in the function definition
@numanshaikh25, have u seen the lectures on pointers?
here char array is passed in parameter ( arrays are always passed by reference only )
even if u write int a[] then also it is passed by reference only.
u need to print what’s inside the bucket so u r using pointers as function return type you are not dereferencing and printing hence directly using pointers ( if u don’t get this don’t worry after watching pointers lecture it will make sense )
okay understood yes pointers lesson is ahead
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.