使用变量指定字符串

编程入门 行业动态 更新时间:2024-10-20 20:34:15
本文介绍了使用变量指定字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

更多推荐

使用变量指定字符串

本文发布于:2023-11-22 06:20:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1616298.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   变量

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!