Q3B [英] q3b

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

问题描述

马克,


我不知道如何用空格或为空。所以我会发布另一种方式

这样做,我不知道如何包含空格。但该计划有效。


比尔


#include< stdio.h>


int main(void){

char a [] = {''0'',''1',''2'',''3'',''4'', ''5'',''6''};

printf("%s \ n",a);

}

Mark,

I don''t know how to do this with spaces or for. So I will post another way
of doing it and I don''t know how to include spaces. But the program works.

Bill

#include <stdio.h>

int main (void) {
char a[]={''0'',''1'',''2'',''3'',''4'',''5'',''6''};
printf("%s\n",a);
}

推荐答案

" Bill Cunningham" < no **** @ nspam.comwrites:
"Bill Cunningham" <no****@nspam.comwrites:

Mark,


我不知道如何用空格或为空格做。所以我会发布另一种方式

这样做,我不知道如何包含空格。但该计划

有效。
Mark,

I don''t know how to do this with spaces or for. So I will post another way
of doing it and I don''t know how to include spaces. But the program
works.



你不走运。看来,我有更多的运气。在我的系统上,我得到:


0123456 ?????????????????????????????????????????????????????????????????? ????????????????????????? b b b b b b b b b b

You were unlucky. I have more luck, it seems. On my system I get:

0123456???-??????H.??????Pt?????????l??????D?H.??????Pt??????

Do you know why?


#include< stdio.h>


int main(void){

char a [] = {''0'', '' 1 '', '' 2 '', '' 3 '', '' 4 '', '' 5 '', '' 6 ''};
#include <stdio.h>

int main (void) {
char a[]={''0'',''1'',''2'',''3'',''4'',''5'',''6''};



我很惊讶:


char a [] = {''0'','''', ''1',''',''''','''','''','''','''''''''''''''''''' '''',''6'};


没有发生在你身上。知道为什么你没有想到它可能比得到正确的程序更有帮助。例如,你是否为
寻找并找不到一个空格的特殊转义序列

字符(就像换行符一样:''\ n''' )。如果是这样你做了什么

当你没找到它?也许你根本就不知道如何写一个空格而且你不知道如何找到这样的东西。我有一个

的感觉,检查这些问题会比你告诉你如何写空间对你更有帮助


I am surprised that:

char a[]={''0'','' '',''1'','' '',''2'','' '',''3'','' '',''4'','' '',''5'','' '',''6''};

did not occur to you. Knowing why you did not think of it is probably
more helpful than getting the program right. For example, did you
look for, and not find, a special escape sequence for a space
character (like there is for newline: ''\n''). If so what did you do
when you did not find it? Maybe you simply did not know how to write
a space and you don''t know any way to find such things out. I have a
feeling that examining these questions will be more helpful to you
than someone telling you how to write a space.


printf("%s \ n",a);

}
printf("%s\n",a);
}



-

Ben。

--
Ben.




" Ben Bacarisse" < be ******** @ bsb.me.ukwrote in message

news:87 ************ @ bsb.me.uk .. 。

"Ben Bacarisse" <be********@bsb.me.ukwrote in message
news:87************@bsb.me.uk...

我很惊讶:


char a [] = {''0'','''' ,''1',''',''''','''','''','''',''''','''','''''' ,'''',''6''};


实际上它确实进入了我的脑海,但我发现会出现一些奇怪的代码。
I am surprised that:

char a[]={''0'','' '',''1'','' '',''2'','' '',''3'','' '',''4'','' '',''5'','' '',''6''};

Actually it did enter my mind but I figured some strange code would occur.



没有发生在你身上。知道为什么你没有想到它可能是

did not occur to you. Knowing why you did not think of it is probably


比让程序正确更有帮助。例如,你是否为
寻找并找不到一个空格的特殊转义序列

字符(就像换行符一样:''\ n''' )。如果是这样你做了什么

当你没找到它?也许你根本就不知道如何写一个空格而且你不知道如何找到这样的东西。我有一个

的感觉,检查这些问题会比你告诉你如何写空间对你更有帮助


more helpful than getting the program right. For example, did you
look for, and not find, a special escape sequence for a space
character (like there is for newline: ''\n''). If so what did you do
when you did not find it? Maybe you simply did not know how to write
a space and you don''t know any way to find such things out. I have a
feeling that examining these questions will be more helpful to you
than someone telling you how to write a space.

> printf("%s \ n",a);
}
> printf("%s\n",a);
}



-

Ben。


--
Ben.



Ben Bacarisse写道:
Ben Bacarisse wrote:

" Bill Cunningham" < no **** @ nspam.comwrites:
"Bill Cunningham" <no****@nspam.comwrites:

>马克,

我不知道如何用空格或为空。所以我会发布
另一种做法,我不知道如何包含
空格。但该计划有效。
> Mark,

I don''t know how to do this with spaces or for. So I will post
another way of doing it and I don''t know how to include
spaces. But the program works.



你不走运。看来,我有更多的运气。在我的系统上我

得到:


0123456 ??? - ?????? H. ?????? Pt ???? ?????????????????????????????????????????????????????????????????

You were unlucky. I have more luck, it seems. On my system I
get:

0123456???-??????H.??????Pt?????????l??????D?H.??????Pt??????

Do you know why?



想想零终止字符串。


char a [] = {''0'','' 1'','''''''''''',''''''''''''''''''''''''''''''}';'




char a [] = {''0'',''1',''2'',''3'','' 4'','''',''6'',0}; / *介意缺少

单引号* /


Wolfgang Draxinger

-

电子邮件地址有效,Jabber: he******@jabber.org ,ICQ:134682867

Think "Zero terminated string".

char a[]={''0'',''1'',''2'',''3'',''4'',''5'',''6'', ''\0''};

or

char a[]={''0'',''1'',''2'',''3'',''4'',''5'',''6'', 0}; /* mind the missing
single quotes here */

Wolfgang Draxinger
--
E-Mail address works, Jabber: he******@jabber.org, ICQ: 134682867


这篇关于Q3B的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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