嵌入式课程作业:结构体与面向对象编程实践.pdfVIP

  • 1
  • 0
  • 约6.29千字
  • 约 6页
  • 2026-07-31 发布于北京
  • 举报

嵌入式课程作业:结构体与面向对象编程实践.pdf

table{边框-collapse:collapse;}table,th,td{border:1pxsolid#000;}

作业内容

作业1内容:

将id为1的员工信息的first_name和salary放入一个结构体变量中并输出这些信息。

作业过程代码参考:

includestdio.h

execsqlincludesqlca;

intmain(){execsqlbegindeclaresection;struct{intid;charname[25];}emp;charuserpwd[30]≡“

openlab/open123”;execsqlenddeclaresection;execsqlconnect:userpwd;execsqlselectid,first_na

meinto:empfroms_impwhereid= 1printf(“%d:%s”,emp.id,);execsqlcommitwork

release;

}

作业2内容:

按照面向对象的方式把proc++的代码封装成一个数据的对象,称之为

mydao.pc,然后用这个类的insertData方法向s_dept中一条数据。

作业代码参考:

文档评论(0)

1亿VIP精品文档

相关文档