Function calls & parameters

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/8

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

9 Terms

1
New cards

C uses which parameter passing strategy?

Pass-by-value

2
New cards

How do you simulate pass-by-reference in C?

Passing pointer addresses

3
New cards

What is copied in pass-by-value?

Only the value

4
New cards

What is copied in pass-by-reference (pointers)?

Pointer address

5
New cards

int a = 3;

void foo(int x){ x = x + 4; }

int main(){ foo(a); printf("%d", a); }

3

6
New cards

void f(int* p){ *p += 10; }

int x = 5;

f(&x);

printf("%d", x);

15

7
New cards

What does return type “void” mean?

Returns nothing

8
New cards

What is a function prototype?

Declaration

9
New cards

A function prototype must appear:

Before main()