I am a bit lost after hours of googling and research. I need to put a CSV containing artist, title, albumName, duration, yearRealeased, and hotttness. I then need to sort the array of structs by title alphabetically.
So far I am just able to get the title but then I get an error while running the compiled code (it prints out 100 or so of the 10000 titles) : "Segmentation fault (core dumped) makefile:5: recipe for target 'test' failed" make: *** [test] Error 139
The layout of the CSV file is: SongNumber, SongID, AlbumID, AlbumName, ArtistID, ArtistLatitude, ArtistLocation, ArtistLongitude, ArtistName, Danceability, Duration, KeySignature, KeySignatureConfidence, Tempo, Hotttnesss, TimeSignature, TimeSignatureConfidence, Title, Year
I do not know how to ignore the values I am not trying to read from the file. As I only need to get the artist, title, albumName, duration, yearRealeased, and hotttness.
Any help would be very appreciated as I am at a complete loss of what to do at this point. Thank You in advance.
I am also getting an error when compiling:
gcc -Wall -Wpedantic -std=c99 *.c -g -o 3240Assignment0
a0.c: In function ‘main’:
a0.c:52:34: warning: implicit declaration of function ‘strsep’ [-Wimplicit-function-declaration]
while ((Token = strsep(&line,","))) {
^
a0.c:52:32: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
while ((Token = strsep(&line,","))) {
^