2013年4月25日

摘要: #include <stdio.h>#include <malloc.h> int main(void){int * msg = NULL;int * msg2 = NULL;int a = 2;msg = (int *)malloc(10);if(NULL == msg) {printf("msg malloc error!\n");}// free(msg); // 1if(NULL == msg2){printf("msg2 malloc error!\n");}msg = &a;msg2 = msg;printf( 阅读全文
posted @ 2013-04-25 20:13 n_a_n_c 阅读(190) 评论(0) 推荐(0)
 

2013年4月15日

摘要: 测试程序: 1 #include <stdio.h> 2 3 #define RANGE(type) \ 4 if ( (type)((type)0 - 1) > 0 ) \ 5 { \ 6 type m = 0; \ 7 m = m - 1; \ 8 printf("%s:\t %d Bytes [%.0f µ½ %.0f] \n", #type, sizeof(type), (double)0, (double)m ); \ 9 } \10 else \11 { \12 ... 阅读全文
posted @ 2013-04-15 19:06 n_a_n_c 阅读(398) 评论(0) 推荐(0)
 
摘要: 如下代码,在进行强制类型转换时,会导致打印出来的数据不是想要的: 1 #include <stdio.h> 2 3 void AddFunc (unsigned int a, unsigned int b, unsigned int * c) 4 { 5 *c = a + b; 6 } 7 8 int main(void) 9 {10 unsigned char e = 100;11 unsigned char f = 200;12 unsigned char g = 0;13 unsigned int p =0;14 15 AddFunc(... 阅读全文
posted @ 2013-04-15 18:59 n_a_n_c 阅读(332) 评论(0) 推荐(0)
 

2012年8月25日

摘要: 一、简介DLL: dynamic link library 动态链接库,它是作为共享函数库的可执行文件,使用它可达到很高的代码重用效果。打开VS2010 -> Visual Stdio Tools -> VS命令提示,使用命令 csc /? 查看是否有csc命令。csc命令格式: csc 选项 *.cs选项介绍: /out:输出文件名 /target:library /reference: dll文件名二、举例 建立两个文件,MySwap.cs(对两个参数交换他们的值)和MyMaxCD.cs(求两个参数的最大公约数)。MySwap.cs 1 using System; 2 3 na 阅读全文
posted @ 2012-08-25 16:07 n_a_n_c 阅读(594) 评论(0) 推荐(0)
 

2012年7月24日

摘要: 队列:先入先出 (只允许在队头删除,队尾插入元素)View Code 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace test_queue 7 { 8 class Program 9 {10 static void Main(string[] args)11 {12 // 定义队列13 Queue<string> strList ... 阅读全文
posted @ 2012-07-24 20:25 n_a_n_c 阅读(373) 评论(0) 推荐(0)
 
摘要: 1、cmd命令行下,输入命令“systeminfo”,如果是64位,会在“OS名称”一行标注“x64 Edition”,否则是32位系统。2、开始->运行,输入命令“winver”,如果系统是64位的,会标注“x64 Edition”。3、右击“我的电脑”,选择属性,若是64位的,会标注。 阅读全文
posted @ 2012-07-24 14:27 n_a_n_c 阅读(477) 评论(1) 推荐(0)