Why whole structure can not be compared in C, yet it can be copied?

后端 未结 6 1667
感情败类
感情败类 2020-12-16 18:08

Why whole structure can not be compared in C yet it can be copied? In other words, Why comparison in below program does not work? It does not print string.

#         


        
6条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 18:59

    It does not print string.

    But it does not even compile :

    error: invalid operands to binary == (have ‘struct emp’ and ‘struct emp’)
    

提交回复
热议问题