• 大小: 2.82KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-01
  • 标签:

资源简介

C++实战源码-指针作为函数的参数(入门级实例096).zip

资源截图

代码片段和文件信息

// PointPara.cpp : Defines the entry point for the console application.
//

#include “stdafx.h“
#include “iostream.h“

void ShowMessage(char * msg)
{
cout << msg << ‘\n‘;
}
int main(int argc char* argv[])
{
//定义字符串数组
char * cp = “大家好,这里是指针作为函数参数的实例。“;
ShowMessage(cp);
//定义字符串数组
char msg[] = “大家好,我的名字是张三。“;
ShowMessage(msg);
//直接传递字符串
ShowMessage(“直接使用字符串作为参数。“);
return 0;
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         476  2010-07-19 09:24  PointPara\PointPara.cpp
     文件        4572  2010-07-19 09:18  PointPara\PointPara.dsp
     文件         543  2010-07-19 09:18  PointPara\PointPara.dsw
     文件         296  2010-07-19 09:18  PointPara\StdAfx.cpp
     文件         769  2010-07-19 09:18  PointPara\StdAfx.h

评论

共有 条评论