可以循环将字符输出到屏幕,怎么循环把字符写如一个字符串,在线等
比如intmain(){inti;for(i=0;i<128;i++)printf("%c",i);return0;}这一个是将整数转化为ascii输入到屏幕;intma...
比如 int main()
{
int i;
for (i = 0; i < 128; i++)
printf("%c", i);
return 0;
}这一个是将整数转化为ascii 输入到屏幕;
int main()
{
int i;
char ascii[128];
for (i = 0; i < 128; i++)
sprintf(ascii,"%c", i);
return 0;
}为什么不可以把整数转换为字符循环写入字符串呢?? 展开
{
int i;
for (i = 0; i < 128; i++)
printf("%c", i);
return 0;
}这一个是将整数转化为ascii 输入到屏幕;
int main()
{
int i;
char ascii[128];
for (i = 0; i < 128; i++)
sprintf(ascii,"%c", i);
return 0;
}为什么不可以把整数转换为字符循环写入字符串呢?? 展开
2个回答
2018-05-05 · 知道合伙人互联网行家
关注
展开全部
void android.graphics.Canvas.drawText(String text,float x,float y,Paint paint)
public void drawText (String text, float x, float y, Paint paint)
Since: API Level 1
Draw the text, with origin at (x,y), using the specified paint. The origin is interpreted based on the Align setting in the paint.
Parameters
text The text to be drawn
x The x-coordinate of the origin of the text being drawn
y The y-coordinate of the origin of the text being drawn
paint The paint used for the text (e.g. color, size, style)
用这个drawText方法,需要Canvas canvas,Paint paint两个对象,具体实现如下
for(int i = 0; i < 10; i++){
canvas.drawText (i,10,i*20,paint);
}
public void drawText (String text, float x, float y, Paint paint)
Since: API Level 1
Draw the text, with origin at (x,y), using the specified paint. The origin is interpreted based on the Align setting in the paint.
Parameters
text The text to be drawn
x The x-coordinate of the origin of the text being drawn
y The y-coordinate of the origin of the text being drawn
paint The paint used for the text (e.g. color, size, style)
用这个drawText方法,需要Canvas canvas,Paint paint两个对象,具体实现如下
for(int i = 0; i < 10; i++){
canvas.drawText (i,10,i*20,paint);
}
2018-05-05
展开全部
第一个字符就是'\0',用%s输出的话直接认为是空字符串
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询