Обсуждения
C++ special bracket usage question
0 голосов
1 ответHow to develop a game
-2 голосов
4 ответов#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 голос
6 ответовАктуальное сегодня
Where is the error
1 Votes
Please help me
2 Votes
Which one is better?? And why??
2 Votes
Use of global function in c
0 Votes
Game
0 Votes
Dc
0 Votes