python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Ternary Operator (?:) based assignment avoids type check in C
I am not able to understand why the compiler doesn't warn when assigning incompatible pointers through (?:) but does warn on direct assignment.
Compiler warns in this case:
test.c: In function ‘main’...
Rajnesh
Votes: 0
Answers: 2
Enable/Disable checkBox based on combobox value with ternary operator
I'm trying to enable checkbox based on comboxbox selection. I am aware that with simple if condtion can solve my problem but when i change it to ternary operator it shows error
if (ComboBox.SelectedV...
pratap
Votes: 0
Answers: 1
Can I assign and return without a utility routine?
Is there a way to "assign and return" without creating a utility routine? Here's my code:
static int& do_work_(const int* p, int& result)
{
result = (*p) * 10;
return result;
...
Jack Brown
Votes: 0
Answers: 1
Ternary operator return nothing
is there a way to return nothing for ternary operator I mean
const a = [ 0 ? { name : "example" } : null ]
when i print a = [null]
or:
const a = [ 0 && {name:"example"}]
...

Berkay Bozkurt
Votes: 0
Answers: 3