提交 9b99031a 创建 作者: 赵鹏翀's avatar 赵鹏翀

init template

上级
/Debug
/Release
#include "case.h"
int main(int argc, char* argv[])
{
case1();
case2();
case3();
case4();
case5();
return 0;
}
void case1()
{
int i = add(1, 2);
}
int add(int i, int j)
{
return i + j;
}
void case2()
{
int i = 1;
int a[4];
a[0] = 6;
a[1] = 7;
a[i + 1] = 8;
}
typedef struct _Rec
{
int i;
char c;
int j;
}Rec;
void case3()
{
Rec x;
x.j = 1;
x.c = x.j;
x.i = x.j;
}
typedef struct _TreeNode
{
int val;
struct _TreeNode *lchild, *rchild;
}TreeNode;
void case4()
{
TreeNode* p = (TreeNode*)malloc(sizeof(TreeNode));
p->lchild = p;
p = p->rchild;
}
void case5()
{
int x, y;
if(x > y)
y++;
else
x--;
}
<?xml version="1.0" encoding="gb2312"?>
<OSLProject Version="1.00" Name="case" SubjectID="11c951f4-9b13-40e1-8b73-39ba7d73b89b" ProjectTemplateID="21300c80-71a5-47ed-be64-7c3dd03065a2">
<Configurations>
<Configuration Name="Debug">
<Tool Name="PreBuildEventTool"/>
<Tool Name="CustomBuildTool"/>
<Tool Name="GCCCompilerTool" PreprocessorDefinitions="_DEBUG" GenerateDebugInformation="-1"/>
<Tool Name="PreLinkEventTool"/>
<Tool Name="GCCLinkerTool"/>
<Tool Name="PostBuildEventTool"/>
</Configuration>
<Configuration Name="Release">
<Tool Name="PreBuildEventTool"/>
<Tool Name="CustomBuildTool"/>
<Tool Name="GCCCompilerTool" PreprocessorDefinitions="NDEBUG"/>
<Tool Name="PreLinkEventTool"/>
<Tool Name="GCCLinkerTool"/>
<Tool Name="PostBuildEventTool"/>
</Configuration>
</Configurations>
<Files>
<Filter Name="ͷļ" Filter="h;hpp;hxx">
<File RelativePath=".\case.h">
</File>
</Filter>
<Filter Name="Դļ" Filter="cpp;c;cc;cxx">
<File RelativePath=".\case.c">
</File>
</Filter>
</Files>
</OSLProject>
#ifndef _CASE_H_
#define _CASE_H_
#include <stdio.h>
void case1();
void case2();
void case3();
void case4();
void case5();
int add(int i, int j);
#endif /* _CASE_H_ */
添加文件
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论