当前位置: 首页 > news >正文

做搜狗手机网站排网络营销师是做什么的

做搜狗手机网站排,网络营销师是做什么的,已经有域名如何做网站,万方期刊网官网2.函数传参: 2.1赋值传递&#xff08;复制传递&#xff09;函数体内部想要使用函数体外部变量值的时候使用复制传递2.2全局变量传递#include <stdio.h>int Num1 100; int Num2 200; int Ret 0;void Add(void) {Ret Num1 Num2;return; }int main(void) {Add();printf…
2.函数传参:
2.1赋值传递(复制传递)函数体内部想要使用函数体外部变量值的时候使用复制传递2.2全局变量传递
#include <stdio.h>int Num1 = 100;
int Num2 = 200;
int Ret = 0;void Add(void)
{Ret = Num1 + Num2;return;
}int main(void)
{Add();printf("Ret = %d\n", Ret);return 0;
}
2.3地址传递函数体内部想要修改函数体外部变量值的时候使用地址传递

示例1:

#include <stdio.h>int SetNum(int *pTmp)
{*pTmp = 100;return 0;
}int main(void)
{int Num = 0;SetNum(&Num);printf("Num = %d\n", Num);return 0;
}

示例2:

#include <stdio.h>int Swap(int *px, int *py)
{int tmp = 0;tmp = *px;*px = *py;*py = tmp;return 0;
}int main(void)
{int Num1 = 100;int Num2 = 200;Swap(&Num1, &Num2);printf("Num1 = %d, Num2 = %d\n", Num1, Num2);return 0;
}
    函数体内想修改函数体外指针变量值的时候传指针变量的地址即二级指针
#include <stdio.h>int SetPoint(char **pptmp)
{*pptmp = "hello world";return 0;
}int main(void)
{char *p = NULL;SetPoint(&p);printf("p = %s\n", p);return 0;
}
2.4整形数组传递int a[5] = {1, 2, 3, 4, 5};int Fun(int parray[5]);int Fun(int parray[], int len);int Fun(int *parray, int len);

示例1:

#include <stdio.h>#if 0
int PrintArray1(int parray[5])
{int i = 0;printf("sizeof:%ld\n", sizeof(parray));for (i = 0; i < 5; i++){printf("%d ", parray[i]);}printf("\n");return 0;
}int PrintArray2(int parray[], int len)
{int i = 0;printf("sizeof:%ld\n", sizeof(parray));for (i = 0; i < len; i++){printf("%d ", parray[i]);}printf("\n");return 0;
}
#endifint PrintArray3(int *parray, int len)
{int i = 0;for (i = 0; i < len; i++){printf("%d ", parray[i]);}printf("\n");return 0;
}int main(void)
{int a[5] = {1, 2, 3, 4, 5};//	PrintArray1(a);
//	PrintArray2(a, 5);PrintArray3(a, 5);return 0;
}

示例2:

#include <stdio.h>int Fun(int (*p)[3], int len)
{int i = 0;int j = 0;for (j = 0; j < len; j++){for (i = 0; i < 3; i++){printf("%d ", p[j][i]);}printf("\n");}return 0;
}int main(void)
{int a[2][3] = {1, 2, 3, 4, 5, 6};Fun(a, 2);return 0;
}
2.5字符型数组和字符串的传递char str[32] = {"hello world"};int Fun(char *pstr);2.6二维数组传递
(1)整形二维数组传递int a[2][3] = {1, 2, 3, 4, 5, 6};int Fun(int (*parray)[3], int len);
(2)字符型二维数组传递char str[5][32] = {"hello", "world", "how", "are", "you"}; int Fun(char (*pstr)[32], int len);
#include <stdio.h>int Fun(char (*pstr)[32], int len)
{int i = 0;for (i = 0; i < len; i++){printf("pstr[%d] = %s\n", i, pstr[i]);}return 0;
}int FunPointArray(char **parray, int len)
{int i = 0;for (i = 0; i < len; i++){printf("parray[%d] = %s\n", i, parray[i]);}return 0;
}int main(void)
{char str[5][32] = {"hello", "world", "how", "are", "you"};char *a[5] = {str[0], str[1], str[2], str[3], str[4]};int i = 0;Fun(str, 5);FunPointArray(a, 5);return 0;
}
2.7指针数组传递char *pstr[5] = {NULL};int Fun(char **ppstr, int len);

2.8结构体传递
(1)结构体变量传递
struct student s;

int Fun(struct student tmp);

#include <stdio.h>struct student
{char name[32];char sex;char age;int score;
};struct student GetStuInfo(void)
{struct student stu;gets(stu.name);scanf("%c", &stu.sex);scanf("%d", &stu.age);scanf("%d", &stu.score);return stu;
}void PutStuInfo(struct student tmp)
{printf("姓名:%s\n", tmp.name);printf("性别:%c\n", tmp.sex);printf("年龄:%d\n", tmp.age);printf("成绩:%d\n", tmp.score);return;
}int main(void)
{struct student s;s=GetStuInfoByPoint(&s);PutStuInfo(s);return 0;
}

(2)结构体指针传递
struct student s;

int Fun(struct student *ps);

#include <stdio.h>struct student
{char name[32];char sex;char age;int score;
};int GetStuInfoByPoint(struct student *ps)
{gets(ps->name);scanf("%c", &ps->sex);scanf("%d", &ps->age);scanf("%d", &ps->score);return 0;
}int PutStuInfoByPoint(struct student *ps)
{printf("姓名:%s\n", ps->name);printf("性别:%c\n", ps->sex);printf("年龄:%d\n", ps->age);printf("成绩:%d\n", ps->score);return 0;
}int main(void)
{struct student s;GetStuInfoByPoint(&s);PutStuInfoByPoint(&s);return 0;
}

(3)结构体数组传递
struct student stu[3];

int Fun(struct student *pstu, int len);

#include <stdio.h>struct student 
{char name[32];char sex;int age;int score;
};int PrintStuInfo(struct student *pstu, int len)
{int i = 0;for (i = 0; i < len; i++){printf("姓名:%s\n", pstu[i].name);printf("性别:%c\n", pstu[i].sex);printf("年龄:%d\n", pstu[i].age);printf("成绩:%d\n", pstu[i].score);}return 0;
}int main(void)
{struct student stu[3] = {{"zhangsan", 'm', 19, 100},{"lisi", 'f', 18, 90},{"wanger", 'm', 17, 60},};PrintStuInfo(stu, 3);return 0;
}
http://www.hkea.cn/news/696789/

相关文章:

  • 网站用花生壳nas做存储百度seo发包工具
  • wordpress cache深圳纯手工seo
  • 怎样找到正规代加工网站百度地图3d实景地图
  • 潍坊网站建设公司网站搭建免费
  • 惠州做网站好的公司下载百度语音导航地图安装
  • 春节网站怎么做小说排行榜百度搜索风云榜
  • 商城服务是什么软件seo是指什么岗位
  • 无锡网站建设有限公司网站快速收录的方法
  • 网站建设通报推广网站多少钱
  • 网络推广公司成都seo排名优化教程
  • 一台手机登录微信网页版西安优化外
  • 如何做旅游攻略网站长沙seo优化推荐
  • 长春火车站电话咨询电话快排seo
  • 龙城建设网站公司网站内容优化方法
  • 南通网站建设搭建网站卖链接
  • 驻马店市做网站seo臻系统
  • 找公司做网站怎么图片都要自己找百度推广官网电话
  • 网站小样用什么做seo外链平台热狗
  • 建站点的步骤sem是什么
  • 深圳专业做网站的衡水网站优化推广
  • 徐汇科技网站建设2345中国最好的网址站
  • 邢台论坛吧百度seo收录软件
  • 做国外服务器网站吗怎么让百度搜索靠前
  • 做动态图网站有哪些自建站怎么推广
  • web网站开发课程设计报告seo技术培训沈阳
  • 会宁网站建设公司网站优化助手
  • 网站设计制作体会2023年5月最新疫情
  • 月亮湾设计有限公司网站南宁seo产品优化服务
  • 福田欧曼服务站电话上海高端seo公司
  • 高端网站建设哪家好谷歌seo和百度seo