当前位置:网站首页>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
- Osgearth topographic shading map drawing
- Deeply understand the underlying data structure of MySQL index
- 【Rust 笔记】10-操作符重载
- 【Rust 笔记】09-特型与泛型
- Dom4j遍历和更新XML
- producer consumer problem
- 【Rust 笔记】11-实用特型
- 【Rust 笔记】12-闭包
- Concurrent programming (III) detailed explanation of synchronized keyword
猜你喜欢

XPath实现XML文档的查询

Gradle's method of dynamically modifying APK package name

【Rust笔记】02-所有权

Chocolate installation

Simple demo of solving BP neural network by gradient descent method

Es8 async and await learning notes

VIM learning notes from introduction to silk skating
![[set theory] order relation (total order relation | total order set | total order relation example | quasi order relation | quasi order relation theorem | bifurcation | quasi linear order relation | q](/img/76/6561a78b7f883a0e75a53e037153c3.jpg)
[set theory] order relation (total order relation | total order set | total order relation example | quasi order relation | quasi order relation theorem | bifurcation | quasi linear order relation | q
![[concurrent programming] consistency hash](/img/5e/3d0a52caa8ca489a6e6267274bbb39.jpg)
[concurrent programming] consistency hash

Life cycle of Servlet
随机推荐
记忆化搜索 AcWing 901. 滑雪
Redux - learning notes
Deeply understand the underlying data structure of MySQL index
【Rust 笔记】07-结构体
Unity Editor Extension - event handling
基于SSM的校园失物招领平台,源码,数据库脚本,项目导入运行视频教程,论文撰写教程
Solution of 300ms delay of mobile phone
How does unity fixedupdate call at a fixed frame rate
JS ternary operator - learning notes (with cases)
Markdown learning
Deep parsing (picture and text) JVM garbage collector (II)
Simple demo of solving BP neural network by gradient descent method
Monotonic stack -503 Next bigger Element II
Cloudcompare learning (1) - cloudcompare compilation and common plug-in implementation
【Rust 笔记】11-实用特型
【Rust笔记】02-所有权
cres
C language student management system based on linked list, super detailed
20220630学习打卡
Eating fruit