Q&A Discussies
C++ special bracket usage question
0 Stemmen
1 AntwoordHow to develop a game
-2 Stemmen
4 Antwoorden#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 Stem
6 AntwoordenPopulair vandaag
Debugging issue?
0 Votes
Text editor
0 Votes
how to view only application
0 Votes
I’m really confused
0 Votes
What is Typecasting?
1 Votes
Subscription
0 Votes
Stream
0 Votes
Scraping
0 Votes
Make a app
0 Votes