0

What is the best way to read string input from a simple Objective-C console application?

I would just like to store the input as an NSString variable.

I've seen multiple people post about scanf, gets and others, but they everyone seems to say that they're "unreliable", or "open to attack".

I can see how this could be true for gets but I'm looking for the best possible way to do this.

Thanks!

1 Answer 1

1

scanf should be mostly secure as long as you use your input correctly.

I've heard of scanf_s which is supposed to be more secure but work the same way.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.