上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 56 下一页
摘要: C++ 数组作为函数参数示例: #include <iostream> static void print(const int* beg, const int* end) { while (beg != end) { std::cout << *beg++ << std::endl; } } sta 阅读全文
posted @ 2024-07-18 09:16 double64 阅读(53) 评论(0) 推荐(0)
摘要: 这个是 GPT 回答的,可以运行。 #include <iostream> #include <memory> class Base { public: virtual void show() const { std::cout << "Base class" << std::endl; } vir 阅读全文
posted @ 2024-07-17 17:04 double64 阅读(84) 评论(0) 推荐(0)
摘要: 代码示例,主要来自《C++ Primer》,动态内存相关那章内容。 #include <iostream> #include <memory> #include <string> namespace { // 未初始化的智能指针,默认保存的空指针 void def_null_sp_test(); / 阅读全文
posted @ 2024-07-17 13:23 double64 阅读(16) 评论(0) 推荐(0)
摘要: #include <iostream> #include <memory> using namespace std; class A; class B { public: B(shared_ptr<A> a) { pa = a; cout << "B 构造..." << endl; } ~B() { 阅读全文
posted @ 2024-07-16 14:40 double64 阅读(13) 评论(0) 推荐(0)
摘要: Mvvmlight 绑定 ItemSource ▲ 界面 XAML: <Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="htt 阅读全文
posted @ 2024-07-10 13:46 double64 阅读(17) 评论(0) 推荐(0)
摘要: 参考:《深入浅出WPF》P49 阅读全文
posted @ 2024-07-03 15:50 double64 阅读(17) 评论(0) 推荐(0)
摘要: XAML: <Window x:Class="WpfApp3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/win 阅读全文
posted @ 2024-07-02 15:52 double64 阅读(57) 评论(0) 推荐(0)
摘要: XAML: <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <StackPanel Grid.Row="0"> <TextBox x:Name="t 阅读全文
posted @ 2024-07-02 15:30 double64 阅读(65) 评论(0) 推荐(0)
摘要: XMAL: <Window x:Class="WpfApp3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/win 阅读全文
posted @ 2024-06-28 16:11 double64 阅读(23) 评论(0) 推荐(0)
摘要: // 反射判断是否位某个类型 public bool IsSubclassOf(this Type type, Type baseType) { // 如果type不是null并且baseType是一个类(非接口) if (type != null && baseType.IsClass) { re 阅读全文
posted @ 2024-02-27 20:17 double64 阅读(115) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 56 下一页