摘要:
#include <iostream> #include <string> #include <windows.h> using namespace std; //方式一 使用指针 void swap1(int* a, int* b) { //指针作为函数的参数 int tmp = *a; *a = 阅读全文
posted @ 2022-09-22 17:52
wshidaboss
阅读(1316)
评论(0)
推荐(0)
摘要:
void => 空类型 void* => 空类型指针,只存储地址的值,丢失类型,无法访问,要访问其值,我们必须对这个指针做出正确的类型转换,然后再间接引用指针。 所有其它类型的指针都可以隐式自动转换成void类型指针,反之需要强制转换。 #include <iostream> #include <s 阅读全文
posted @ 2022-09-22 17:16
wshidaboss
阅读(59)
评论(0)
推荐(0)
摘要:
创建Student类的对象,并为相应属性赋值,并打印输出各属性值。 class Student{ private long studentId; private int classId; private int age; private String studentName; public long 阅读全文
posted @ 2022-09-22 16:58
wshidaboss
阅读(2525)
评论(0)
推荐(0)
浙公网安备 33010602011771号