C++中 主函数咋调用其他函数啊?在vs工具箱里添加控件AspNetPager

时间:2018-01-20 08:40:01   浏览:次   点击:次   作者:   来源:   立即下载

第①种: 定义了fun();

主函数中写fun();就调用了。

#include iostream

using namespace std;

void printstar(void)

{

cout**************************endl;

}

void print_message(void)

{

coutWelcome to C++!endl;

}

int main(void)

{

printstar();//调用

print_message();//调用

printstar();//调用

return ⓪;

}

第②种:#includeiostream.h

int sum(int a,int b)//有返回值的函数定义

{

return a+b;

}

void output(int c)//没有返回值函数的定义

{

coutcendl;

}

int main()

{

int x=⑤ · y=⑥;

int z;

z=sum(x,y);//有返回值的函数调用

output(z);//没有返回值函数的调用

}

页面需要加这个; %webdiyerWuqi.Webdiyer TagPrefix=AspNetPager Namespace=%@ Register Assembly="

收起

相关推荐

相关应用

平均评分 0人
  • 5星
  • 4星
  • 3星
  • 2星
  • 1星
用户评分:
发表评论

评论

  • 暂无评论信息