写一个只能C编译通过,而C++不能编译通过的函数。
来源:互联网 发布:sql中count 1 的用法 编辑:程序博客网 时间:2024/05/18 01:54
写一个只能C编译通过,而C++不能编译通过的函数。
#include <stdio.h>int main(void){ int new = 5; // new is a keyword in C++, but not in C printf("%d", new);}
------对于C++中拥有,C中没有的关键字都可以。eg。delete,try,template,
写一个C,C++运行结果不一样的函数。
(1)C中把char类型作为int型来对待
#include<stdio.h>int main(){ printf("%d", sizeof('a')); return 0;}
(2)C中没有bool类型
// output = 4 in C (which is size of int)printf("%d", sizeof(1==1)); // output = 1 in c++ (which is the size of boolean datatype)cout << sizeof(1==1);
0 0
- 写一个只能C编译通过,而C++不能编译通过的函数。
- 通过下载的内核编译hello.c
- C实现topcoder的SquareDigits(编译通过)
- 没啥事用C语言写一个Trie tree玩玩,支持中英文,用g++编译通过
- C实现KnightsTour(编译通过)
- 一个不能编译通过的多线程示例程序
- 编译通过不能执行
- 生产者、消费者 C源码,gcc编译通过
- 通过GCC编译器编译c语言
- C#: 通过动态编译获取字符串所表达的值
- C#: 通过动态编译获取字符串所表达的值
- 单链表的C语言实现[GCC编译通过]
- Android上通过gcc编译普通的C程序
- java通过jni调用c编译的dll或so
- Linux通过vi编写C程序,通过gcc编译
- hello world编译不能通过
- [C/C++]_[通过编译器获取编译日期]
- 通过流程图对比编译型语言,解释型语言以及C#,JAVA的编译流程
- jQuery 清除div内容
- 栈和堆
- 烂泥:Server-U FTP与AD完美集成方案详解
- android 自定义View(一、基础认识)
- chef client注册为node
- 写一个只能C编译通过,而C++不能编译通过的函数。
- Java环境搭建(Windows环境)
- A potentially dangerous Request.Path value was detected from the client 异常
- 常用的数据库语法
- 查看可执行程序的依赖库
- Linux输入子系统
- Java JVM(八):Lambda 简介
- 移动开发测试工具——Bugtags的集成
- svn and maven 自动部署shell脚本