大虾,帮忙看一下,怎么解决问题?
#include <stdio.h>#include <stdlib.h>
struct mp3File
{
char TAG[3];
char title[30];
char artist[30];
char album[30];
char year[4];
char comments[30];
unsigned char genre[1];
};
int main(int argc,char *argv[])
{
struct mp3File mTestFile;
FILE *fp;
if((fp=fopen( "argv[0]", "rb+ "))==NULL)
{
printf( "Read File Error!\n ");
exit(0);
}
fseek(fp,-128L,2);
fgets(mTestFile.TAG,4,fp);
printf( "TAG ");
printf( "%s\n ",mTestFile.TAG);
fgets(mTestFile.title,31,fp);
printf( "title ");
printf( "%s\n ",mTestFile.title);
fgets(mTestFile.artist,31,fp);
printf( "artist ");
printf( "%s\n ",mTestFile.artist);
fgets(mTestFile.album,31,fp);
printf( "album ");
printf( "%s\n ",mTestFile.album);
fgets(mTestFile.year,5,fp);
printf( "year");
printf( "%s\n ",mTestFile.year);
fgets(,31,fp);
printf( "comments ");
printf( "%s\n ",);
fclose(fp);
return 0;
}
我想用这个程序读出部分MP3文件的相关信息
但是运行之后输出的都是Read File Error!
大虾,帮忙看一下,告诉一下解决的方法,或提一种可行的更好的方法
非常感谢