It's UWAweek 48

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

Displaying selected article
Showing 1 of 919 articles.
Currently 2 other people reading this forum.


 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported

Login to reply

👍?
helpful
3:28pm Wed 7th Sep, Christopher M.

ANONYMOUS wrote:
> I don't understand why the second parameter has to be a pointer to a pointer; why can we not just pass endptr to strtol instead of passing &endptr, the address of the pointer?
If endptr was just an integer, and you wanted the function to be able to change that integer's value, you'd have to pass the address of endptr to the function. Similarly, even if endptr is a pointer to a char, if you want the function to be able to change that pointer's value, you have to pass the address of endptr to the function.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  1:17AM Sep 14 2022
Privacy policy