This question already has answers here:
Can code that is valid in both C and C++ produce different behavior when compiled in each language?
                                
                                    (19个回答)
                                
                        
                        
                            Different output for different compiler - C and C++ [duplicate]
                                
                                    (7个答案)
                                
                        
                                6年前关闭。
            
                    
在C和C ++中都有效但具有不同语义的语法示例有哪些?换句话说,用C和C ++编译器编译时产生不同输出的程序示例是什么?

最佳答案

sizeof('c') — C ++中的1,与C中的sizeof(int)相同。

关于c++ - C/C++之间具有相同语义的相同语法,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21223422/

10-11 18:32