回程 [英] Carriage return

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

问题描述

任何人都可以帮忙!!!!!!

我想开发一个应该计算代码行数的程序。

我想要的知道什么是C中的回车价值。

所以请尽快回复我。如果可能,请将代码发给我。

谢谢。

推荐答案

任何人都可以帮助!!!!!!

我想开发一个应该计算代码行的程序。

我想知道什么是C中的回车价值。

所以请尽快回复我。如果可能发送我也是代码。

谢谢。



回车价值是''\ r'',换行值是'' \\\
'。单引号用于获取其中字符的字符值。即''A''是65.


我们不会在这里给你任何代码。如果您需要帮助,请自行尝试问题,如果您仍然遇到问题,请发布重要代码,说明您遇到的问题是什么。


好好运,


Adrian


PS不要双重发帖。谢谢。请参阅发布指南此处


\ r是回车

\ n是回车+新换行


可能你想要\ n。
\r is carriage return
\n is carriage return + newline feed

Probably you want \n.



\ r是回车

\ n是回车+换行请求


可能你想要\\\

\r is carriage return
\n is carriage return + newline feed

Probably you want \n.



如果你想获得技术,在阅读/写入文本文件时,你是正确的......在Windoze下。它虽然不便携。


不同的操作系统对它的定义不同。 IIRC,Unix将\ n定义为仅回车,Mac将其定义为换行+回车(与Windows相反),其他操作系统我不是一个线索。由于这种可移植性问题,我不再使用文本文件了,除非我确信生成的文件永远不会转移到另一个操作系统或我不在乎;)。


Adrian

If you want to get technical, in reading from/writing to a text file you are correct... under Windoze. It is not portable though.

Different operating systems define it differently. IIRC, Unix defines \n as carriage return only, Mac defines it as line feed + carriage return (reverse of Windows), other OSs I haven''t a clue. I no longer work with text files anymore because of this portability issue, unless I am sure that the file generated will never be shifted to another OS or I don''t care ;).


Adrian


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

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