void myFunction(string country = "Norway") {
cout << country << "
";
}
int main() {
myFunction("Sweden");
myFunction("India");
myFunction();
myFunction("USA");
return 0;
}
// Sweden
// India
// Norway
// USA
void point(int x = 3, int y = 4);
point(1,2); // calls point(1,2)
point(1); // calls point(1,4)
point(); // calls point(3,4)
Rational CreateRational(int num, int denom=1) {
Rational result;
result.numerator=num;
result.denominator=denom;
return result;
}
Code Example |
---|
Cpp :: c++ initialize vector of vector with size |
Cpp :: C++ break with for loop |
Cpp :: find second highest number in c++ |
Cpp :: sizeof operator in c++ |
Cpp :: stoi() c++ |
Cpp :: prisma client |
Cpp :: initialize dynamic array c++ to 0 |
Cpp :: c++ if else |
Cpp :: print duplicate characters from string in c++ |
Cpp :: detect cycle in an undirected graph |
Cpp :: length of string in c++ |
Cpp :: c++ filesystem read directory |
Cpp :: cpp float |
Cpp :: c++ string find example |
Cpp :: c++ string split |
Cpp :: C++ code for Dijkstra’s Algorithm |
Cpp :: unordered_map contains key |
Cpp :: input n space separated integers in c++ |
Cpp :: c++ saying hello world |
Cpp :: c++ #define |
Cpp :: c++ range based for loop |
Cpp :: initialize vector |
Cpp :: find function in c++ |
Cpp :: vector size |
Cpp :: how to declare a vector of int in c++ |
Cpp :: how to empty a std vector |
Cpp :: onoverlapbegin ue4 c++ |
Cpp :: power in c++ |
Cpp :: iterate const vector |
Cpp :: 344. reverse string c++ |