用C ++读取文件(fseek(fi,0L,SEEK_SET); [英] Read file in C++ (fseek(fi, 0L, SEEK_SET);
本文介绍了用C ++读取文件(fseek(fi,0L,SEEK_SET);的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我说一点英语,希望你理解。非常感谢!
我有问题
在我的文件中有代码......
fseek(fi,0L,SEEK_SET);
我不知道什么是字符0L?我知道这个位置(0L)是一个数字,但是它有L。你可以向我解释一下吗?非常感谢。
I speak a little English and I hope you understand. Thank you very much!
I have a problem
In my file has code...
"fseek(fi, 0L, SEEK_SET);"
I don't known what is characters "0L"? As I know this position("0L") is a number, but this has "L". You can explain to me? Thank you very much.
推荐答案
谷歌是回答这类基本问题的最好方法。
如果你看看fseek,你会找到第二个参数offset是一个长整数。
www.cplusplus.com/reference/cstdio / fseek / [ ^ ]
0L是告诉编译器你不想要0 int而你想要0 long int的方法。
http://forums.codeguru.com/showthread .php?154957-What-do-0L-mean& p = 427386#post427386 [ ^ ]
Google is the best way to answer this type of basic question.
If you look at fseek you will find the second parameter offset is a long integer.
www.cplusplus.com/reference/cstdio/fseek/[^]
0L is a way of telling the compiler that you don't want 0 int but you want 0 long int.
http://forums.codeguru.com/showthread.php?154957-What-does-0L-mean&p=427386#post427386[^]
我猜0L表示0号为Long typ e,因为该功能需要长数字
我记得以浮点表示0.0,我们也可以写0.0f
希望这对你有所帮助!
顺便问一下,你是越南语kimnguyentran ??
I guess 0L is to indicate the 0 number is in Long type, as the function requires long number at that point
I remember to indicate 0.0 in floating point, we can write 0.0f too
Hope this help you!
By the way, are you Vietnamese kimnguyentran??
这篇关于用C ++读取文件(fseek(fi,0L,SEEK_SET);的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文