void operands to the conditional operator [on hold]

Can someone explain me what to do with void operands to the conditional operator [on hold]


I'm completely lost. I personally think my syntax is good :/

Here's additional void operands to the conditional operator [on hold]

related to it.


The function declared as cs() has a void return type. You're trying to use that function's return value (void) as a possible result of the condition statement.

The compiler doesn't know how to assign void to the bool value k.

The error message is:

second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'

It seems like you could just solve this (or at least change the error message) by making the third operand void. So in your code, you would change k?cs():k=k; to k?cs():(void)(k=k);.

Actually, why are you even assigning k to itself? That looks like nonsense. You could change the third operand to just be something like (void)0 I think.

Category: c# Time: 2016-07-29 Views: 0
Tags: file

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.132 (s). 12 q(s)