pike数据类型(一)

      本人英语水平比较差劲,下面不知道怎么翻译恰当的地方,暂时应用原文,日后翻译!如果有感兴趣的朋友,可以留下你的翻译.

      这个章节主要是详细的介绍pike中几种数据存储方式.我们已经看到过很多例子,但是我们并不知道它们是如何工作的.这个章节我们会介绍每个不同类型的操作和方法.在pike中有两类数据类型:基本数据类型和指针类型(暂且怎么翻译,以后有合适的教法再修改).它们的不同之处是:

引用
The difference is that basic types are copied when assigned to a variable. With pointer types, merely the pointer is copied, that way you get two variables pointing to the same thing.

[size=small;] 基本类型
[/size]
      基本类型是:整型,浮点型,字符串.
引用
For you who are accustomed to C or C++, it may seem odd that a string is a basic type as opposed to an array of char, but it is surprisingly easy to get used to.

[size=small;] 指针类型
[/size]
   
基本类型,就像它们的名字一样是非常基础的.它们是根本,大多数的指针类型,不过是另外的方式存储基本类型.指针类型包括:数组,mapping,multiset,program,object,和function.它们是指针型,即它们在内存中指向一些内容.
引用
This "something" is freed when there are no more pointers to it. Assigning a variable with a value of a pointer type will not copy this "something" instead it will only generate a new reference to it. Special care sometimes has to be taken when giving one of these types as arguments to a function; the function can in fact modify the "something". If this effect is not wanted you have to explicitly copy the value. More about this will be explained later in this chapter.




你可能感兴趣的:(C++,c,工作,C#)