From b0dc2399c79d57a6738ffe41301acb7c532b4af2 Mon Sep 17 00:00:00 2001 From: Lucas Rufkahr Date: Mon, 2 Mar 2026 14:48:38 -0600 Subject: [PATCH] update functions.md --- content/cpp/functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cpp/functions.md b/content/cpp/functions.md index ba94075..f4840bd 100644 --- a/content/cpp/functions.md +++ b/content/cpp/functions.md @@ -43,4 +43,4 @@ Suppose you want a function to occassionaly not have values for parameters expli void average(float num1 = 3, float num2 = 3, float num3 = 3); ``` -In this example, the default parameters were create in the function prototype. Suppose you call the function by `average();`, then without passing and values, num1, num2, and num3 were all initialized with 3 as we have define in the prototype. Default arguments also work with just one parameter. You can set whatever parameter you want to have a default argument. Also, as long as the default argument is defined in the prototype, you should not include it in the definition. +In this example, the default parameters were create in the function prototype. Suppose you call the function by `average();`, then without passing and values, num1, num2, and num3 were all initialized with 3 as we have define in the prototype. Default arguments also work with just one parameter. You can set whatever parameter you want to have a default argument. Also, as long as the default argument is defined in the prototype, you should not include it in the definition. __Keep in mind, default arguments must be at the end of the parameter list.__