单击桌面进入Codeblocks的安装目录下,
CodeBlocks\share\CodeBlocks\templates\wizard\console\
,
新建C文件的默认模板:
D:\Program Files (x86)\CodeBlocks\share\CodeBlocks\templates\wizard\console\c
修改main.c
文件为想要的模板。
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
printf("Hello world!\n");
return 0;
}
/**
******************************************************************************
* @file standard_c_program.c
* @author XXX $(author)
* @version V1.0.0
* @date 14-December-2019 $NOW_L
* @brief This file contains all the Source File.
******************************************************************************
* @attention
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
//#include "standard_c_program.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
/**
* @brief main
* @note None
* @param None
* @arg
* @retval None
*/
int main(int argc, char *argv[]) {
printf("Hello world!\n");
return 0;
}
/******************************** END OF FILE *********************************/
新建C++文件的默认代码:
D:\Program Files (x86)\CodeBlocks\share\CodeBlocks\templates\wizard\console\cpp
修改main.cpp文件为你想要的模板。
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}