上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: string str = "sdfsdfsd1234fsdf"; cout << str.size() << endl; cout << str.insert(str.size(), "123") << endl; cout << str.find("123") << endl; cout << str.substr(0, 4) << endl; cou... 阅读全文
posted @ 2017-12-08 10:46 我是外婆 阅读(77) 评论(0) 推荐(0) 编辑
摘要: char str[] = "123"; // strlen 只计算可见字符, sizeof 则包含'\0' 在内 cout << "strlen : " << strlen(str) << endl; cout << "sizeof :" << sizeof(str) << endl; char name[10]; char name1[10]; ... 阅读全文
posted @ 2017-12-08 09:52 我是外婆 阅读(96) 评论(0) 推荐(0) 编辑
摘要: int main() { int* p; //这表明*p 类型为int, 由于*被用于指针,因此p变量本身必须为指针 //我们说p 是指向int类型,可以这样说p 为指针(地址),而*p是int而不是指针 int a[3] = {1, 2, 3}; p = &a[0]; cout arr1(2); //分配在堆 array arr2 = {1,... 阅读全文
posted @ 2017-12-06 16:11 我是外婆 阅读(115) 评论(0) 推荐(0) 编辑
摘要: class Program { public static void Main(string[] args) { test t = new test(); test.Test(t); Console.WriteLine(t.Name); Console.Read... 阅读全文
posted @ 2017-12-04 11:07 我是外婆 阅读(222) 评论(0) 推荐(0) 编辑
摘要: class mysqlEasyHeper{ private string _conStr = "server=localhost; user id=root; port=3308; password=root; charset=utf8; pooling=true"; private MySqlConnection _con; public string conState... 阅读全文
posted @ 2017-11-28 17:58 我是外婆 阅读(155) 评论(0) 推荐(0) 编辑
摘要: public static void Main(string[] args) { // 语法 select element 选中返回的查询的结果集 //select 不仅可以为数据源中的元素,还可以是该元素的不同的操作结果,包括 //属性 方法 运算等 Student[] stu = ... 阅读全文
posted @ 2017-11-25 10:42 我是外婆 阅读(117) 评论(0) 推荐(0) 编辑
摘要: int[] arr = new int[]{1, 3, 5, 7 ,9}; var result = from s in arr where s //因为我们知道数组的类型 大多数情况下可以通过var让程序自动判定返回的类型 // 其中 s 默认识别类型为int 当然我们也可以定义一个明确的类型 比如object ... 阅读全文
posted @ 2017-11-23 16:28 我是外婆 阅读(91) 评论(0) 推荐(0) 编辑
摘要: namespace console_父类子类 { class Program { public static void Main(string[] args) { showTest t = new showTest(); // 情况1 默认情况下调用父类的方法 t.show(n... 阅读全文
posted @ 2017-11-23 10:44 我是外婆 阅读(1542) 评论(0) 推荐(0) 编辑
摘要: public class taskTest { private int _taskNums = 100; //初始化100个任务 private Semaphore _semaphpre; //信号量控制任务并发的数量 private const int _max = 5; //最大任务并发数 private Hashtab... 阅读全文
posted @ 2017-11-22 14:20 我是外婆 阅读(188) 评论(0) 推荐(0) 编辑
摘要: default 关键字。 default 关键字可用于 switch 语句或默认值表达式中: switch 语句:指定默认标签。 默认值表达式:生成类型的默认值。 对于引用类型,将为 NULL;对于值类型,将为零;对于结构,将为 0 位模式。 switch 语句:指定默认标签。 默认值表达式:生成类 阅读全文
posted @ 2017-11-22 09:29 我是外婆 阅读(105) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页