字符数组和字符串之间有什么区别? [英] What is the difference between a Character Array and a String?

查看:606
本文介绍了字符数组和字符串之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花时间在高级语言上,突然发现我不知道字符数组和字符串之间的区别.我认为他们是同一回事,但不确定.有区别吗?仅仅是带有某种抽象的字符数组吗?

Spending my time on high level languages it suddenly occurred to me that I did not know the difference between a Character Array and a String. I think they are the same thing but not sure. Is there a difference? Is it just a Character Array with some abstraction?

推荐答案

字符数组只是字符数组

字符串是使用字符数组的数据结构

a string is data structure that uses an array of characters

某些字符串表示形式使用空终止符(如C),另一些使用长度前缀

some string representations use a null-terminator (like C), others use a length prefix

这篇关于字符数组和字符串之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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