3 ms·
Lambdas are a C++ thing, not C. If 0 and 1 are the only possible values, you can be much much more elegant: string x = y ? "bar" : "foo"; Else: string x = (
by dyingkneepad 6y ago
Lambdas are a C++ thing, not C.
If 0 and 1 are the only possible values, you can be much much more elegant:
string x = y ? "bar" : "foo";
Else:
string x = (y == 1) ? "bar" : (y == 0) ? "foo" : "";