关于char指针 [英] about char pointer
问题描述
请解释我,char指针,char数组,char,字符串......
i对此有一些很多的讨论...
请向我澄清..
i需要一些关于这个程序的例子
by
chellappa.ns
hi ,
please explain me , char pointer , char Array, char ,string...
i have some many confussion about this...
please clarify to me..
i need some example about this program
by
chellappa.ns
推荐答案
chellappa写道:
chellappa wrote:
请解释我,char指针,char数组,字符串,字符串......
please explain me , char pointer , char Array, char ,string...
关于C的一本不错的书将解释所有这些,并且比通过Usenet滴水喂养要快得多。但是:
一个`char指针`是一个指向字符的指针。
一个`char array`是一个数组,其元素是字符。 />
一个`char`是一个/表示一个字符的值。
一个`字符串`是一个以
null结尾的字符序列( == 0)字符。
[字符序列`是
数组或mallocated商店中的连续切片。]
-
Chris" electric hedgehog" Dollin
它被称为*极端*编程,而不是*愚蠢*编程。
A decent book on C will explain all this, and be faster than
drip-feeding via Usenet. But:
A `char pointer` is a pointer that points to characters.
A `char array` is an array whose elements are characters.
A `char` is a value which is/represents a character.
A `string` is a sequence of characters terminated by a
null (== 0) character.
[A `sequence of characters` is a contiguous slice out of an
array or mallocated store.]
--
Chris "electric hedgehog" Dollin
It''s called *extreme* programming, not *stupid* programming.
请举几个例子
please give some examples
" chellappa" < N ********* @ gmail.com>。在消息中写道
news:11 ********************** @ z14g2000cwz.googlegr oups.com ...
"chellappa" <N.*********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
请举几个例子
请在发布时保留上下文。谢谢。
请拿到一本教科书。没有
一个你就不会走得太远。
" Chris Dollin" <柯** @ hpl.hp.com>在留言中写道
news:da ********** @ malatesta.hpl.hp.com ... chellappa写道:
please give some examples
Please preserve context when posting. Thank you.
Please get a textbook. You won''t get far without
one.
"Chris Dollin" <ke**@hpl.hp.com> wrote in message
news:da**********@malatesta.hpl.hp.com... chellappa wrote:
请解释我,char指针,char数组,字符串,字符串...
关于C的一本不错的书将解释所有这些,并且比通过Usenet进行滴灌更快。但是:
一个`char指针`是一个指向字符的指针。
一个`char数组`是一个数组,其元素是字符。
一个`char`是一个/表示字符的值。
字符串`是由
null(== 0)字符终止的字符序列。
[字符序列`是一个
数组或mallocated商店的连续切片。]
please explain me , char pointer , char Array, char ,string...
A decent book on C will explain all this, and be faster than
drip-feeding via Usenet. But:
A `char pointer` is a pointer that points to characters.
A `char array` is an array whose elements are characters.
A `char` is a value which is/represents a character.
A `string` is a sequence of characters terminated by a
null (== 0) character.
[A `sequence of characters` is a contiguous slice out of an
array or mallocated store.]
" chellappa" < N ********* @ gmail.com>。在消息中写道
新闻:11 ********************** @ z14g2000cwz.googlegr oups.com ...请举几个例子
"chellappa" <N.*********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com... please give some examples
char * p; / *''char pointer''(a.k.a。''指向char的指针'')。 * /
/ *可以表示类型''char''对象的地址* /
char a [10]; / *''char array''(a.k.a。''char''数组)。 * /
/ *可存储十种类型''char''对象* /
/ *连续内存位置* /
char c; / *一个类型''char''对象。可以表示任何一个* /
/ *的执行字符集的值* /
char s [10] =" Hello" ; / *''char array''(a.k.a。''char''数组)。 * /
/ *数组的前六个元素* /
/ *(s [0]到s [5]包含)包括* /
/ * a''string''* /
-Mike
char *p; /* ''char pointer'' (a.k.a. ''Pointer to char''). */
/ * can represent address of a type ''char'' object */
char a[10]; /* ''char array'' (a.k.a. ''array of char''). */
/* can store ten type ''char'' objects at */
/* contiguous memory locations */
char c; /* a type ''char'' object. Can represent any one */
/* of the values of the execution character set */
char s[10] = "Hello" ; /* ''char array'' (a.k.a. ''array of char''). */
/* The first six elements of the array */
/* (s[0] through s[5] inclusive) comprise */
/* a ''string'' */
-Mike
这篇关于关于char指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!