Skip to content

Comment on Interacting with C Pointers

Comments

> For safety, Swift requires the variables to be initialized before being passed with &. This is because it cannot know whether the method being called tries to read from a pointer before writing to it.

Isn't the 'maybeError' var being used uninitialized in the example right about this passage?

It actually does get initialized, albeit intialized to "nil". Someone asked the same question on the devforums. https://devforums.apple.com/thread/238423?tstart=0

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.