https://github.com/zhangwinning/c-_test
c++/v8 practice
https://github.com/zhangwinning/c-_test
Last synced: 6 months ago
JSON representation
c++/v8 practice
- Host: GitHub
- URL: https://github.com/zhangwinning/c-_test
- Owner: zhangwinning
- Created: 2020-04-14T09:29:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-21T01:14:29.000Z (over 5 years ago)
- Last Synced: 2025-06-04T11:36:15.890Z (7 months ago)
- Language: C++
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[toc]
## helloWorld
使用 g++ 编译程序,试过 gcc 不好使。后期查过 c 编译使用 gcc, c++ 编译使用 g++。
```
g++ -o helloworld helloworld.cpp
```
## 2. 常量
```cpp
/**
* 常量的定义方式
* 1. #define 宏常量
* 2. const 修饰的常量
**/
#include
using namespace std;
#define DAY 7
int main() {
cout << "一周总共多少天" << DAY << "天"<< endl;
// const 修饰的变量
const int month=12;
cout << "一年有" << month << "月份"<< endl;
return 0;
}
```