2008年11月27日 星期四
学点 C 语言(21): 数据类型 - 数组与指针
万一| 万一的 Delphi 博客 |22:10:00
1. 获取数组的地址无须 &, 因为数组名本身就是个地址#include <stdio.h> int main() { char c = 'A'; char cs[] = "ABC"; printf("%c, %s\n", c, cs); /* 获取字符及字符数组的内容 */ printf("%p, %p, %p\n", &c, cs, &cs); /* 获取...
重写一个字符串分割函数 - 回复 "tomzw" 的问题
万一| 万一的 Delphi 博客 |21:11:00
问题来源:http://www.cnblogs.com/del/archive/2008/11/27/967440.html#1384363unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TBu...
学点 C 语言(20): 数据类型 - 指针
万一| 万一的 Delphi 博客 |19:44:00
1. 通过 &变量 可以获取变量地址:#include <stdio.h> int main() { int num = 10; printf("变量值: %d\n", num); printf("变量址: %d\n", &num); getchar(); return 0; }2. 表示变量地址的变量就是指针:#include <stdio.h> int main()...
Why Generics Constraints ?
Felix Colibri| Felix Colibri’s Delphi Blog |18:51:01
are generics constraints absolutely necessary to compile generic source code into binary code ? In short flexibility vs security.
AMRandom 4.2
CodeGear| CodeGear-CodeCentral Delphi |18:47:50
This aims to supply a Borland/CodeGear Delphi translation of Alan Miller's Random Module for FORTRAN-90. This translation has been done with Dr Miller's approval and is being made FREELY available to all Delphi Developers, though we do ask the Ala...
学点 C 语言(18): 数据类型 - 枚举类型(enum)
万一| 万一的 Delphi 博客 |14:00:00
1. printf 枚举可显示枚举的序号:#include <stdio.h> int main() { enum ABC{AAA,BBB,CCC}; enum ABC e1,e2,e3; e1 = AAA; e2 = BBB; e3 = CCC; printf("%d, %d, %d\n", e1, e2,e3); getchar(); return 0; }2. 定义枚举?..
学点 C 语言(17): 数据类型 - 因类型引发的问题或错误
万一| 万一的 Delphi 博客 |13:38:00
1. 运算结果超出类型大小:#include <stdio.h> #include <limits.h> int main() { short s1 = SHRT_MAX; short s2 = SHRT_MAX; short num1; int num2; /* 不会是期望的值 */ num1 = s1 + s2; printf("%d\n", num1); /* 这样...
CodeGear RAD Studio 2009 Trial with Delphi Prism ISO
CodeGear| CodeGear-CodeCentral Delphi |13:03:53
The Delphi Prism 2009 ISO can be used with a trial serial number (available from the left side of this page) to install a 14-day trial of the Delphi Prism portion of RAD Studio 2009. The ISO can also be sued with any purchased RAD Studio 2009 or D...
CodeGear RAD Studio 2009 Trial with Delphi/C++Builder 2009 ISO
CodeGear| CodeGear-CodeCentral Delphi |13:00:38
The Delphi and C++Builder 2009 ISO can be used with a trial serial number (available from the left side of this page) to install a 14-day trial of the Delphi and C++Builder 2009 Architect portion of RAD Studio 2009. The ISO can also be sued with a...
CodeGear RAD Studio 2009 Trial - install from the Web
CodeGear| CodeGear-CodeCentral Delphi |12:58:38
Fully functional 14-day trial of CodeGear RAD Studio 2009 Architect Includes Delphi 2009, C++Builder 2009 and Delphi Prism 2009 - English, German, French and JapaneseRAD Studio is a combination of three products. The Delphi and C++Builder 2009 pie...
学点 C 语言(16): 数据类型 - 关于常量的前缀、后缀
万一| 万一的 Delphi 博客 |12:18:00
曾经对 float num = 3.14f; 这样的赋值非常疑惑, 其实现在也不明白. 既然说明了是 float 类型, 又何必在 3.14 后面挂个 f 呢? 书上说: int num = 100; 一个整数常量将默认为 int 类型 double num = 3.14; 一个浮点数常量将默认为 double 类型 并要求: long nu...
Blaise Pascal Magazine issue #4
Bob Swart| Dr.Bob’s Delphi Notes |11:07:38
Blaise Pascal Magazine issue #4 is now released and available for download from http://www.blaisepascal.eu/.
学点 C 语言(15): 数据类型 - sizeof(检测类型大小)
万一| 万一的 Delphi 博客 |10:47:00
获取类型大小的变量最好不是 int 类型, 而是 size_t 类型;size_t 在 stdio.h、stddef.h 都有定义.1. 获取已知类型的大小:#include <stdio.h> #include <stddef.h> int main() { char n = 2; size_t size; size = sizeof(char); printf("%*u:...
学点 C 语言(14): 数据类型 - 双字节字符类型 wchar_t
万一| 万一的 Delphi 博客 |10:22:00
在 C 语言中, char 类型永远都是一个字节, 双字节字符类型是 wchar_t;但它不是内置类型, 定义在 stddef.h.给 wchar_t 类型的字符或字符数组(也就是字符串)赋值要冠以 L;格式化输出(如 printf) wchar_t 类型的字符串, 要用 %S(而非 %s) 标识.#include <stdio.h> #i...
学点 C 语言(13): 数据类型 - 整型、字符型和浮点型的扩展
万一| 万一的 Delphi 博客 |09:52:00
整型 int 可添加 short 和 long: short int: 简为 short; long int: 简为 long; long long int: 简为 long long 它们都可以再添加 unsigned: unsigned int: 简为 unsigned unsigned short int: 简为 unsigned short unsigned long int: ...





冀公网安备 13098202000212号