随笔分类 -  c++

摘要:``` include using namespace std; class Box { public: double length; // 长度 double breadth; // 宽度 double height; // 高度 }; int main( ) { Box Box1; // 声明 阅读全文
posted @ 2019-03-13 19:18 luoganttcc 阅读(98) 评论(0) 推荐(0) 编辑
摘要:``` include include using namespace std; // 声明一个结构体类型 Books struct Books { char title[50]; char author[50]; char subject[100]; int book_id; }; int mai 阅读全文
posted @ 2019-03-13 19:08 luoganttcc 阅读(124) 评论(0) 推荐(0) 编辑
摘要:``` include using namespace std; int main() { char name[50]; cout name; cout 阅读全文
posted @ 2019-03-13 18:56 luoganttcc 阅读(107) 评论(0) 推荐(0) 编辑
摘要:``` include using namespace std; int main () { int var; int ptr; int pptr; var = 3000; // 获取 var 的地址 ptr = &var; // 使用运算符 & 获取 ptr 的地址 pptr = &ptr; // 阅读全文
posted @ 2019-03-13 13:59 luoganttcc 阅读(325) 评论(0) 推荐(0) 编辑
摘要:``` include using namespace std; const int MAX = 3; int main () { int var[MAX] = {10, 100, 200}; int ptr; // 指针中的数组地址 // 数组名是数组的首地址 ptr = var; for (in 阅读全文
posted @ 2019-03-13 13:57 luoganttcc 阅读(433) 评论(0) 推荐(0) 编辑
摘要:``` include using namespace std; int main () { int var = 20; // 实际变量的声明 int ip; // 指针变量的声明 ip = &var; // 在指针变量中存储 var 的地址 cout 阅读全文
posted @ 2019-03-13 13:53 luoganttcc 阅读(111) 评论(0) 推荐(0) 编辑
摘要:``` include using namespace std; int main () { int var1; char var2[10]; cout 阅读全文
posted @ 2019-03-13 13:50 luoganttcc 阅读(74) 评论(0) 推荐(0) 编辑
摘要:``` include include using namespace std; int main () { string str1 = "Hello"; string str2 = "World"; string str3; int len ; // 复制 str1 到 str3 str3 = s 阅读全文
posted @ 2019-03-13 13:42 luoganttcc 阅读(105) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示