Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Ternary operator - warnings about unsued values

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.32 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 3 Mb, absolute service time: 0,54 sec  
edit mode |  history  | discussion
Warning(s):
source_file.cpp: In function ‘int main()’:
source_file.cpp:7:38: warning: left operand of comma operator has no effect [-Wunused-value]
         std::cout << ((0) ? (1) : (2,3,4,5,6)) << std::endl;
                                      ^
source_file.cpp:7:40: warning: right operand of comma operator has no effect [-Wunused-value]
         std::cout << ((0) ? (1) : (2,3,4,5,6)) << std::endl;
                                        ^
source_file.cpp:7:42: warning: right operand of comma operator has no effect [-Wunused-value]
         std::cout << ((0) ? (1) : (2,3,4,5,6)) << std::endl;
                                          ^
source_file.cpp:7:44: warning: right operand of comma operator has no effect [-Wunused-value]
         std::cout << ((0) ? (1) : (2,3,4,5,6)) << std::endl;
                                            ^
6

    
                
λ
.NET NoSQL database for rapid development