使用变量指定字符串 [英] using a variable to specify a string

查看:89
本文介绍了使用变量指定字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码段都打算使用变量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.


这篇关于使用变量指定字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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