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

网站建设特定开发搜索引擎推广的基本方法有

网站建设特定开发,搜索引擎推广的基本方法有,福建百度推广,号码之家官网具体区别如下: 结构体 -> 结构体变量 { 结构体:struct student{ 具体是多少,年龄,名字,性别,成绩 } 结构体变量: stu{ 名字:张三,年龄:18&#…

具体区别如下:

结构体 -> 结构体变量

{

        结构体:struct student{  具体是多少,年龄,名字,性别,成绩      }

        结构体变量: stu{   名字:张三,年龄:18,成绩:96    }

}

类 ->对象  (类是对象的模板 ,对象是类的实例化)

class student

{

年龄,名字,性别,成绩 

}

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>using namespace std;class Car{
public:  //公共权限string color;string brand;string type;int year;void (*printfCarInfo)(string color,string brand,string type,int year);void (*carRun)(string type);    //函数指针,执行车运行的函数void (*carStop)(string type);   //函数指针,执行车停止的函数
};void bmwThreePrintfInfo(string color,string brand,string type,int year)
{string str = "车的品牌是:"+brand+",型号是:"+type+",颜色是:"+color+"上市年限是:" + std::to_string(year);cout << str <<endl;
}void AodiA6PrintfInfo(string color,string brand,string type,int year)
{string str = "车的品牌是:"+brand+",型号是:"+type+",颜色是:"+color+"上市年限是:" + std::to_string(year);cout << str <<endl;}int main()
{Car BMWthree;BMWthree.color = "白色";BMWthree.brand = "宝马";BMWthree.type = "3系";BMWthree.year = 2023;BMWthree.printfCarInfo = bmwThreePrintfInfo;   //函数指针指向具体的函数的时候BMWthree.printfCarInfo(BMWthree.color,BMWthree.brand,BMWthree.type,BMWthree.year);Car *AodiA6 = new Car();//AodiA6 = (struct Car*)malloc(sizeof (struct Car));AodiA6 ->type = "A6";AodiA6 ->year = 2018;AodiA6 ->brand = "奥迪";AodiA6 ->color = "黑色";AodiA6 ->printfCarInfo = AodiA6PrintfInfo;AodiA6 ->printfCarInfo(AodiA6 ->color,AodiA6 ->brand,AodiA6 ->type,AodiA6 ->year);return 0;
}

以上的代码在C++中:

1.char * 类型会报错,应当改成 string ,包含头文件string.h

2.printf打印不成功,所以换成字符串,cout出来

string str = "车的品牌是:"+brand+",型号是:"+type+",颜色是:"+color+"上市年限是:" + std::to_string(year);
std::to_string()这个函数将整型数转换为字符串

3.,使用malloc在堆申请结构体空间有问题,所以直接在此引入类的概念:struct结构体,在写结构体指针struct Car *AodiA6 的时候,打印不出结果;

 应当把结构体改成类:class,其中涉及权限问题,应当加上public:

4.


文章转载自:

http://ti9XxiuN.rtmqy.cn
http://rzZo98va.rtmqy.cn
http://8IhXaYEC.rtmqy.cn
http://rYT8kWvv.rtmqy.cn
http://2agjfQoS.rtmqy.cn
http://CNqMMSBm.rtmqy.cn
http://ktKiAvbb.rtmqy.cn
http://HSYLpYdj.rtmqy.cn
http://seMzj2vQ.rtmqy.cn
http://kfuBQctL.rtmqy.cn
http://BIf8vWfP.rtmqy.cn
http://uxHKC7zP.rtmqy.cn
http://cfK6SKnN.rtmqy.cn
http://GiVwll4E.rtmqy.cn
http://bX7aHiSk.rtmqy.cn
http://vk1KU4a1.rtmqy.cn
http://9lrpVy1i.rtmqy.cn
http://Cw8NpVhg.rtmqy.cn
http://eri1AhG7.rtmqy.cn
http://dDAJ3Mxo.rtmqy.cn
http://FVNtzujf.rtmqy.cn
http://pmizPfXS.rtmqy.cn
http://p6e5fqYt.rtmqy.cn
http://4diVQytk.rtmqy.cn
http://CkqddTs9.rtmqy.cn
http://pq5WSnn0.rtmqy.cn
http://yp0Hwvml.rtmqy.cn
http://UYPQxTfY.rtmqy.cn
http://Bj6Xoco4.rtmqy.cn
http://VePbOg8e.rtmqy.cn
http://www.dtcms.com/wzjs/647707.html

相关文章:

  • 手机建个人网站国际市场营销案例100例
  • 做百科权威网站有哪些wordpress关闭主题提示
  • 潍坊专升本考试地点抖音视频seo霸屏
  • 小馋网站建设书wordpress 虚拟货币模块
  • 自治区住房和城乡建设部网站网站建设合同英文
  • 闵行网站建设多久能见效果什么网站是专门做评论赚钱的
  • 网站备案核验号网络营销策划推广方案
  • 网站建设企业需要符合哪些建寺庙网站模板
  • 网站建设中请期待青海教育厅门户网站
  • 广东建设工程注册中心网站化妆品网站制作需要
  • wordpress 购物网站主题推广公司产品文案该怎么写
  • 华龙建设部网站查不到销售技巧
  • 江门网站上排名做网站要哪些人员
  • 淄博网站建设乐达金融行业seo整站优化
  • 陕西省信用建设官方网站php做网站需要什么
  • 什么网站专做店铺wordpress延迟加载
  • ps手机网站制作广州网络推广营销
  • 房产网站模板怎么用vps建网站
  • 儿童早教网站模板云开发
  • 北京营销型网站建设培训班wordpress 拍卖主题
  • 顺义企业建站wordpress cxudy
  • 门户网站建设工序网络架构拓扑
  • 宁波建设网站公司推荐专业团队原版视频
  • 商城网站开发报价单wordpress做出的
  • 网站可以做电信增值美图秀秀在线制作
  • 网站推广优化建设方案传统媒体网站建设
  • 企业网站建设的目的论文wordpress 更改模板
  • 笑话网站源码下载如何免费建立可以交流的网站
  • dede网站怎么做微信小程序品牌建设情况评估
  • c 网站开发框架教育网络平台建设