+ 1
What is the difference between structure and function and arrays
Getting a bit confused so
7 Réponses
+ 3
Alright what confused you? I'm not here to re explain what is in the course.
+ 2
No. Functions are loops of code that execute some statements. Structures are datatypes that hold data.
+ 2
Function - Subprograms that can be called by the main function repeatedly (like add(int a,int b),you can call it to do addition)
Array - A sequence of values in a fixed size ( You can imagine this as a box)
Struct - A group of elements under one name .
For example :
struct gender{
string male;
string female;
}
+ 1
No what is better
+ 1
Function and structure are same right
+ 1
So we can't write statement in structure and function we can right
+ 1
Shortly:
-Array is a sequence of values.
-Function is a piece of normal code with a name. When functions are called, they take in arguments, run their code and return a value.