这些“char”之间的差异 [英] difference between between these "char"s

查看:86
本文介绍了这些“char”之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这两者之间有什么区别:


char name =" hackers";

char * name =" hackers";

what is the difference between these 2:

char name = "hackers";
char* name = "hackers";

推荐答案

char name =" hackers";


i对此一无所知。
char name = "hackers";

i do not know anything about this.

char * name =" hackers" ;;
char* name = "hackers";



i guess,这将成为一个char数组,名称将指向

数组的第一个元素.ie


名称和名称[0]意思相同


对吧?

i guess, this will become an array of "char"s and name will point to
1st element of the array .i.e.

name and name[0] will mean same

right ?


On 3月4日下午2:38,arnuld < geek.arn ... @ gmail.comwrote:
On Mar 4, 2:38 pm, "arnuld" <geek.arn...@gmail.comwrote:

char name =" hackers" ;;
char name = "hackers";



我对此一无所知。


i do not know anything about this.


char * name =" hackers" ;;
char* name = "hackers";



i guess,这将成为一个char数组,名称将指向

数组的第一个元素.ie


名称和名称[0]意思相同


对吗?


i guess, this will become an array of "char"s and name will point to
1st element of the array .i.e.

name and name[0] will mean same

right ?



我不认为

char name =" hackers" ;;声明是有效的。


char name表示char类型的变量,其大小为一个字节。


问候,
Sarath

I dont this think that
char name = "hackers"; statement is a valid one.

char name means a variable of type char which has one byte in size.

Regards,
Sarath


文章< 11 ******************** **@t69g2000cwt.googlegroups .com> ;,
ge ********* @ gmail。 com 说...
In article <11**********************@t69g2000cwt.googlegroups .com>,
ge*********@gmail.com says...

这两者之间有什么区别:


char name =" hackers" ;;

char * name =" hackers" ;;
what is the difference between these 2:

char name = "hackers";
char* name = "hackers";



主要区别在于第二个会编译,但是第一个

不会。

也许你打算:


char name [] =" hackers";

vs.

char * name =" hackers";





-

后来,

杰瑞。


宇宙是自己想象的虚构。

The main difference is that the second will compile, but the first one
won''t.

Perhaps you intended:

char name[] = "hackers";
vs.
char *name = "hackers";

?

--
Later,
Jerry.

The universe is a figment of its own imagination.


这篇关于这些“char”之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆