当前位置:网站首页>Format - C language project sub file
Format - C language project sub file
2022-07-03 08:50:00 【Cap07】
1. The header file (head.h):
// Declaration for storing functions
// The main function is to be quoted by other documents :#include"head.h"
#define _CRT_SECURE_NO_WARNINGS // If not defined here , If quoting this (head.h) Of cpp This definition should be used in the document , Then it needs define
#include<stdio.h> // If the header file is not referenced here , Then quote this (head.h) Of cpp Write your own reference in the document
void temp1();
void temp2();2. Implementation of functions in header file (head.cpp):
// The main function is to realize the header file (head.h) The function in
#include"head.h" // Reference the header file (head.h) All definitions in , Include define, Referenced header file, etc .
void temp1() {
int x;
scanf("%d", &x);
printf("temp1\n");
temp2();
}
void temp2() {
printf("temp2\n");
}3. The main program (c1.cpp):
//#define _CRT_SECURE_NO_WARNINGS // When the referenced header file (head.h) When this definition is included in , It can be deleted here
//#include<stdio.h> // When the referenced header file (head.h) When this header file is included in , It can be deleted here
#include"head.h" // quote head.h, Want to refer directly to all the contents of its definition , Indirect reference head.cpp
int main() {
temp1();
return 0;
}4. Running results :

边栏推荐
- [rust notes] 06 package and module
- Try to reprint an article about CSDN reprint
- Osgearth starry background
- Unity editor expansion - the design idea of imgui
- 【Rust 笔记】07-结构体
- MySQL containerization (1) docker installation MySQL
- [rust notes] 07 structure
- Unity Editor Extension - Outline
- DOM 渲染系统(render mount patch)响应式系统
- Life cycle of Servlet
猜你喜欢

Try to reprint an article about CSDN reprint

Binary to decimal, decimal to binary

Dom4j traverses and updates XML

Servlet的生命周期

Installation of PHP FPM software +openresty cache construction

Sending and receiving of request parameters

Cloudcompare learning (1) - cloudcompare compilation and common plug-in implementation

UE4 source code reading_ Mobile synchronization

22-06-27 西安 redis(01) 安装redis、redis5种常见数据类型的命令

22-06-28 Xi'an redis (02) persistence mechanism, entry, transaction control, master-slave replication mechanism
随机推荐
Development material set
Binary to decimal, decimal to binary
Downward compatibility and upward compatibility
TP5 order multi condition sort
Unity learning notes
【Rust 笔记】12-闭包
796 · unlock
Chocolate installation
Gradle's method of dynamically modifying APK package name
Final review of Database Principles
First Servlet
请求参数的发送和接收
Redis cluster series 4
Unity interactive water ripple post-treatment
单调栈-42. 接雨水
分配异常的servlet
Pit & ADB wireless debugging of vivo real machine debugging
Development experience and experience
[rust notes] 13 iterator (Part 1)
Allocation exception Servlet