-
What is the difference between a function and a method?
A- A function returns a value, but a procedure does not. A method is similar to a function, but is internal to part of a class. The term method is used almost exclusively in object-oriented programming. A function is something that takes a bunch of inputs and returns one or more values.
-
Why are structures a better way to define data than just declaring a series of variables?
A- A structure definition is like a blueprint for the structure. It takes up no storage space itself instead just specifies what variables of this structure type will look like. An actual structure variable is like a box with multiple data fields inside of it. Consider the idea of a student database. One student record contains multiple items of information (name, address, SSN, GPA, etc)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (3)
Bud, not bad, but try adding more to your post, beginners for swift will need more information. Like what a structure is, etc.. Also, don't call it "Swift stuff", no one is going to take you seriously with that title. I learnt swift in a couple months and I've got to tell you, every thing that you put here is in one lesson. For your next post write something that people want to hear about, or just you own personal experience with swift.
This is all for school. I have to post what they ask of me nothing more nothing less, sorry if you don't like it.
k, u do u
Some comments have been hidden by the post's author - find out more