1/8
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
C uses which parameter passing strategy?
Pass-by-value
How do you simulate pass-by-reference in C?
Passing pointer addresses
What is copied in pass-by-value?
Only the value
What is copied in pass-by-reference (pointers)?
Pointer address
int a = 3;
void foo(int x){ x = x + 4; }
int main(){ foo(a); printf("%d", a); }
3
void f(int* p){ *p += 10; }
int x = 5;
f(&x);
printf("%d", x);
15
What does return type “void” mean?
Returns nothing
What is a function prototype?
Declaration
A function prototype must appear:
Before main()