it read from /dev/sda, write to file, default size is 512 bytes, skip 3 512 bytes and read 1 time.
so basically, his code write 512 byte data to that offset (3*512) of sda. then use thsi tool to read to a file. and then use hexdump to show the content to verify his write is succ.
我早上将代码编译了一遍出现了如下错误:
#gcc -o test.c test
gcc: test: No such file or directory
gcc: no input files
请问那段代码向扇区写的是什么?是mytest吧?是的话,要不要在我的硬盘上新建一个mytest文件?
谢谢斑竹
mytest is a string. it is initiialized in code and use in code. frankly, i am worrying about u c language knowledge and whether u can finish u code as u wish.
不好意思,我太急了,我的c语言是很差的,我现在正在恶补
我换了命令了
#gcc -o test test.c
可是也出现了错误:
test.c:I function 'main':
test.c:30:'return' undeclared (first use in this function)
test.c:30Each undeclared identifier is reported only once
test.c:30:for each function it appears in.)
test.c:30:parse error before numeric constant
test.c:31:2:warning:nonewline at end of file
是不是return还要定义?(不太可能吧)
特别是最后一个错误,我好经常遇到,是什么原因呢?我的内核是2.4.18
一直麻烦你,真是不好意思,可是我真的很需要这段代码,谢谢
can you help me ,please!
i have no time , next week i much finish my code!
yesterday i just know what is my task. but i am poor in c
so please help me ,thank you very much
[quote:fa2d06ab9f="hlf1099210"]不好意思,我太急了,我的c语言是很差的,我现在正在恶补
我换了命令了
#gcc -o test test.c
可是也出现了错误:
test.c:I function 'main':
test.c:30:'return' undeclared (first use in this function)
test.c:30Each undeclared identifier is reported only once
test.c:30:for each function it appears in.)
test.c:30:parse error before numeric constant
test.c:31:2:warning:nonewline at end of file
是不是return还要定义?(不太可能吧)
特别是最后一个错误,我好经常遇到,是什么原因呢?我的内核是2.4.18
一直麻烦你,真是不好意思,可是我真的很需要这段代码,谢谢[/quote]
i can compile it without any problem. check the code and try to compile again.
that new line warning is only a warning, ignore it.