F&A Diskussionen
C++ special bracket usage question
0 Stimmen
1 AntwortHow to develop a game
-2 Stimmen
4 Antworten#include <iostream>
using namespace std;
int sum(int a, int b=42) {
int result = a + b;
return (result);
}
int main() {
int x = 24;
int y = 36;
//calling the function with both parameters
int result = sum(x, y);
cout << result << endl;
//calling the function without b
result = sum(x);
cout << result << endl;
return 0;
}
why is da last function cout 66 and not 48 isn't it suppose to add 24+24?
1 Stimme
6 AntwortenHeute heiß
Moving image
4 Votes
Check it out
1 Votes
Want to confirm
0 Votes
Help make cool game
0 Votes
I need help again 😁
0 Votes
Webler Codes
0 Votes
Python
0 Votes