当前位置:网站首页>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 :
边栏推荐
- 第一个Servlet
- Allocation exception Servlet
- Final review of Database Principles
- How does unity fixedupdate call at a fixed frame rate
- [rust notes] 07 structure
- Constraintlayout's constraintset dynamically modifies constraints
- Mortgage Calculator
- Cloudcompare learning (1) - cloudcompare compilation and common plug-in implementation
- [rust notes] 06 package and module
- ES6 promise learning notes
猜你喜欢
Gif remove blank frame frame number adjustment
Try to reprint an article about CSDN reprint
Phpstudy 80 port occupied W10 system
Concurrent programming (VI) ABA problems and solutions under CAS
Installation of PHP FPM software +openresty cache construction
I made mistakes that junior programmers all over the world would make, and I also made mistakes that I shouldn't have made
[concurrent programming] working mechanism and type of thread pool
22-06-27 西安 redis(01) 安装redis、redis5种常见数据类型的命令
Deep parsing (picture and text) JVM garbage collector (II)
单调栈-84. 柱状图中最大的矩形
随机推荐
file_ put_ contents
Monotonic stack -84 The largest rectangle in the histogram
[linear table] basic operation of bidirectional linked list specify node exchange
UE4 source code reading_ Mobile synchronization
Unity editor expansion - window, sub window, menu, right-click menu (context menu)
Dom4j遍历和更新XML
[redis] redis persistent RDB vs AOF (source code)
[concurrent programming] concurrent tool class of thread
Phpstudy 80 port occupied W10 system
Unity editor expansion - the framework and context of unity imgui
[rust notes] 02 ownership
Concurrent programming (VI) ABA problems and solutions under CAS
Redis cluster series 4
20220630学习打卡
Installation of PHP FPM software +openresty cache construction
MySQL three logs
Animation_ IK overview
Annotations simplify configuration and loading at startup
Chocolate installation
MySQL 8