本文介绍了使用变量指定字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下代码段都打算使用变量x来指定字符串hello。验证它们是否正确。 1. char x [256] =hello; 2. char x [256]; x =你好; 3. char * x =你好; 4. char * x; x =你好; 5. char x [256] = {'h','e','l','l','o'};
The following code segments all intend to use variable x to specify a string "hello". Verify if they are correct. 1. char x[256]="hello"; 2. char x[256]; x="hello"; 3. char *x="hello"; 4. char *x; x="hello"; 5. char x[256]={’h’, ’e’, ’l’, ’l’, ’o’};
推荐答案是的,我们没有为你做功课。 你告诉我们答案是什么,我们会告诉你你是否正确。 Yeah, we're not doing your homework for you. You tell us what the answer is and we'll tell you if you're correct or not.
更多推荐
使用变量指定字符串
发布评论