📄 07_01.cpp
字号:
// 07_01.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>
int plus(int x, int y){ return x + y; }
float plus(float x, float y){ return x + y; }
double plus(double x, double y){ return x + y; }
char* plus(char* x, char* y){ return strcat(x, y); }
int main(int argc, char* argv[])
{
int i = 12, j = 34;
float x1 = 1.2, y1 = 4.5;
double x2= 24.5, y2 = 635.4;
char * str1 = "object ", * str2 = "windows";
// char str1[] = "object ", str2[] = "windows";
// char str1[20] = "object ", str2[20] = "windows";
cout << "i + j = " << plus(i, j) << endl;
cout << "x1 + y1 = " << plus(x1, y1) << endl;
cout << "x2 + y2 = " << plus(x2, y2) << endl;
cout << "str1 + str2 = " << plus(str1, str2) << endl;
// cout << "x2 + y2 = " << plus(x2, y2) << endl;
getch();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -