
C++了,虽然练习C还有9题不会做,但是不先继续往下学,肯定就凉了
#include <iostream>
int main() {
	if (__cplusplus == 201703L)std::cout << "C++17\n";
	else if (__cplusplus == 201402L)std::cout << "C++14\n";
	else if (__cplusplus == 201103L)std::cout << "C++11\n";
	else if (__cplusplus == 199711L)std::cout << "C++98\n";
	else std:: cout << "pre-standard C++\n";
	return 0;
} 
属性——语言——命令行——/Zc:__cplusplus
1.1 源文件和编码规范
.C .CXX .CC    .H .HPP .HXX
翻译】geosoft C++ Programming Style Guidelines (已翻译完毕,大家看看自己总结出了哪些吧!) - 阿毛小猪 - 博客园 (cnblogs.com)
1.2 ALOHA WORLD
#include <iostream>//标准库头文件
int main() {
	std::cout << "aloha world" << std::endl;
	return 0;
} 
<<,C左移运算符,运算符重载,流输出运算符,
 NO【制表,分页符】,四个空格,明确返回值,否则默认INT
#include <iostream>
using namespace std;//坑,不建议使用
int main() {
    cout << "aloha world" << endl;//end line
    //保持输出窗口
    cin.get();
    return 0;
} 
1.2.1 多个项目的管理
需要在解决方案管理器中添加才能同时打开两个项目
 同解决方案管理器的属性,选当前那个,或者项目右键,设置为当前
 项目分组,同上右键,同PS操作
1.3 名字空间
std::cout << "aloha world" << std::endl;范围,用来限定某些符号的作用域
#include <iostream>
using std::cout ;
using std::endl;
int main() {
    cout << "aloha world" << endl;//end line
    std::cin.get();//细节
    return 0;
} 
1.5 处理错误
名字空间--隔离标识符的作用范围,有点没懂,能运行,没有输出东西
#include <iostream>
using std::cout ;
using std::endl;
int main() {
    return 0;
}
namespace Myolha{
    int main() {
        cout << "aloha world" << endl;//end line
        std::cin.get();
        return 0;
    }
} 
1.6 输入和输出

#include <iostream>
int main() {
	char c = std::cin.get();
	std::cout<<"c"<< std::endl;
	std::cout << c << std::endl;
	return 0;
} 
男神的网易云课
 VS的类似重构就是,CTRL+R 重命名
#include <iostream>
using namespace std;
int main() {
	int age;
	cout << "enter a decimal number";
	cin >> age;
	cout << "hallo world,i'm " << age<< "." << endl;
	return 0;
} 

累 ,搞不懂活着有什么意思



















![[Windows]服务注册工具(nssm)](https://img-blog.csdnimg.cn/img_convert/4f07740f4f8970ca1e407fc08683e5d7.png)