cpp quiz
2016-07-02 19:13
369 查看
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> class MyClass { public: MyClass(int* a); MyClass(); ~MyClass(); int GetId() { return 5; } private: }; MyClass::MyClass() {} MyClass::MyClass(int* a) { } MyClass::~MyClass() { } int main() { int a = 1; int &b = a; int *c = (int*)malloc(sizeof(int)); int d[4] = { 1, 2, 3, 4 }; c = d; printf("%6d", b); b = 6; char e = 'a'; char *f = "abc"; int g = (int)malloc(sizeof(int)); void *h = malloc(sizeof(int)); std::cout << 1; MyClass *mc = new MyClass(); MyClass m = MyClass(c); printf("%d",mc->GetId()); delete mc; return 0; }
相关文章推荐
- iOS开发- 利用runtime拦截UIButton的点击事件,防止重复点击
- iOS GPUImage之头文件说明
- iOS8统一的系统提示控件——UIAlertController
- iOS GPUImage之实时拍摄添加Faceu效果(6)
- Android进阶(二十六)MenuInflater实现菜单添加
- Android进阶(二十六)MenuInflater实现菜单添加
- Android进阶(二十四)Android UI---界面开发推荐颜色
- Android进阶(二十四)Android UI---界面开发推荐颜色
- Vue.js——60分钟快速入门
- iOS AutoLayout: 从 XIB 中加载 UIViewController
- 设计模式读书笔记(三) Builder(建造者)模式
- UGUI自适应屏幕
- Serial Programming Guide for POSIX Operating Systems
- WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-
- APUE(5)---标准I/O库 (1)
- 如何在debug模式下,使用正式的签名文件
- leetcode: Longest Consecutive Sequence
- windows GUI开发02 - 显示对话框,对话框在资源管理器中布局;
- Code snippet for .vue component in Sublime Text3
- SpannableString与SpannableStringBuilder使用