Anyone else?
Anyone else?
Hi, everyone again, well I completed the MP3 program and it works. Waheey.
I am know just putting the finishing touches on it and wonderd I am trying to clear the screen I am putting this code, but it does not seem to do anything.
It has the error expected primary expression before void.Code:void dispTitle(void) { int i=0; while (i <25) {printf ("\n"); i++;}
Thanks
You might want to provide more context for that code snippet. It looks like an incomplete function, and it may be good to know what comes before it as the problem may lie there.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
ok here goes, this is the first part program
Code:#include <stdio.h> #include <stdlib.h> #include <string.h> #define GENRE_TYPE_SIZE 30 #define NAME_SONG_SIZE 30 #define FILENAME_SONG_SIZE 75 #define ARTIST_NAME_SIZE 75 #define ARRAY_SIZE 100 void Show_the_mp3_song_library(void); void Play_an_mp3song_file(void); void Add_an_mp3song_file(void); void Modify_or_Edit_an_mp3_file(void); void Delete_an_mp3_file(void); void Load_the_music_Library(void); void Save_the_music_Library(void); void show_the_track(int index); void dispTitle(void); FILE *fp; typedef struct mp3rec { char artistname[ARTIST_NAME_SIZE]; char songname[NAME_SONG_SIZE]; char genretype[GENRE_TYPE_SIZE]; char mp3_filename[FILENAME_SONG_SIZE]; int minutes; int seconds; }; mp3rec the_song_list[ARRAY_SIZE]; int songcount = 0; char name_line[NAME_SONG_SIZE+2];//change the buf char artist_line[ARTIST_NAME_SIZE+2]; char genre_line[GENRE_TYPE_SIZE+2]; char mp3_filename_line[FILENAME_SONG_SIZE+2]; int minutes; int seconds; int main (void) { int menuchoice = 0; while(menuchoice != 8) { printf("*******************************\n"); printf("********************************************\n"); printf("***********************\n"); printf("********************************************\n"); printf("*****************Version 1******************\n"); printf("\n1:~ Save the MP3 Library"); printf("\n2:~ Show the MP3 Library"); printf("\n3:~ Play an MP3 Song"); printf("\n4:~ Delete an MP3 Song"); printf("\n5:~ Add MP3 or Song/file to the MP3 Library"); printf("\n6:~ Modify or Edit an MP3 File"); printf("\n7:~ Re-Load the MP3 Library"); printf("\n8:~ Quit The Program"); printf("\n\n~Enter What you Wish to do: "); scanf("%d", &menuchoice); switch (menuchoice) { case 1:Save_the_music_Library(); break; case 2:Show_the_mp3_song_library(); break; case 3:Play_an_mp3song_file(); break; case 4:Delete_an_mp3_file(); break; case 5:Add_an_mp3song_file(); break; case 6:Modify_or_Edit_an_mp3_file(); break; case 7:Load_the_music_Library(); break; case 8: break; default: printf("\n~The Choice Was Invalid : 1-8 Only Please\n\n"); } }; void dispTitle(void) { int i=0; while (i <25) {printf ("\n"); i++;} } }
Basically, you need to improve on your indentation:
So the problem is that The closing brace that comes after the closing brace of dispTitle() should be moved to above it. (And you do not need that semi-colon after the closing brace for the while loop in main().)Code:int main (void) { int menuchoice = 0; while(menuchoice != 8) { printf("*******************************\n"); printf("********************************************\n"); printf("***********************\n"); printf("********************************************\n"); printf("*****************Version 1******************\n"); printf("\n1:~ Save the MP3 Library"); printf("\n2:~ Show the MP3 Library"); printf("\n3:~ Play an MP3 Song"); printf("\n4:~ Delete an MP3 Song"); printf("\n5:~ Add MP3 or Song/file to the MP3 Library"); printf("\n6:~ Modify or Edit an MP3 File"); printf("\n7:~ Re-Load the MP3 Library"); printf("\n8:~ Quit The Program"); printf("\n\n~Enter What you Wish to do: "); scanf("%d", &menuchoice); switch (menuchoice) { case 1:Save_the_music_Library(); break; case 2:Show_the_mp3_song_library(); break; case 3:Play_an_mp3song_file(); break; case 4:Delete_an_mp3_file(); break; case 5:Add_an_mp3song_file(); break; case 6:Modify_or_Edit_an_mp3_file(); break; case 7:Load_the_music_Library(); break; case 8: break; default: printf("\n~The Choice Was Invalid : 1-8 Only Please\n\n"); } }; void dispTitle(void) { int i=0; while (i <25) { printf ("\n"); i++; } } }
Other than that it looks like you have quite a few global variables that could be better off declared in main().
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)