linux 下根据cpp文件快速书写头文件

news/2025/3/15 5:03:42/

假设我们现在有一个hello.cc文件,我们如果想要书写它的头文件hello.h,使用如下的命令即可:

cat hello.cc | grep "^\w.*)$" > hello.h

然后我们在hello.h中添加我们依赖的头文件即可


http://www.ppmy.cn/news/603915.html

相关文章

docker 常用命令集合

查看images docker images 查看container docker ps docker container ps -a 启动container docker container start ##### 暂停container docker container stop ##### 删除container docker container rm ###### 连接container docker attach ####

macos新版本docker换源方法

#macos新版docker换源方法

mac git使用与配置踩过的坑

#mac git使用与配置踩过的坑 标题mac配置git ssh密钥 参考链接mac配置git ssh key go get安装失败的解决方法 go get约等于git clonego install,下载安装git仓代码时报错fatal: could not read Username … terminal prompts disabled。解决方法: 方…

python 实现桶排序

前言 桶排序(Bucket sort)或所谓的箱排序,是一个排序算法,工作的原理是将数组分到有限数量的桶里。每个桶再个别排序(有可能再使用别的排序算法或是以递归方式继续使用桶排序进行排序)。桶排序是鸽巢排序的…

c语言从stdin读入

代码 #include<stdio.h> #include<stdlib.h>int main(int argc, char* argv[]) {char * line NULL;size_t len 0;ssize_t read_len;while ((read_lengetline(&line, &len, stdin)) ! -1) { if (read_len > 0 && line[read_len-1] \n){ …

go坑合集

//创建结构体 type cat struct {Name stringAge intColor stringMark [2]intMmap map[string]string } //实例 func main(){var cat1 catcat1.Color "yellow"cat1.Age 2cat1.Name "123"//对map、切片等引用类型需要先makecat1.Mmap make(map[string]st…

c语言使用指定字符串替换特定的子串

前言 当前程序是在linux环境下执行的 代码 #include<stdio.h> #include<stdlib.h> #include<string.h>#define MAX_UTF8_RES_LEN 1024int replace_all(char* str, size_t strLen, const char* d, const char* s) {char* pos 0;char* prv 0;char temp[MA…