hello, I am trying to pass the array songID[numSongs] to the function playRandomSong. What am i doing wrong? The compiler is telling me "error C2660: 'playRandomSong' : function does not take 1 arguments"
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <cstdlib>
using namespace std;
const int numSongs = 15;
void playRandomSong ();
int main ()
{
char songTYPE [numSongs];
int songID [numSongs],
countSongs,
randomNum;
bool songHasPlayed[numSongs];
string fileName = "songData.txt";
ifstream inFile;
inFile.open( fileName.c_str() ); // should use constant for file name
randomNum = rand () % numSongs;
for (int i = 0; i < numSongs; i++)
{
songHasPlayed[numSongs] = false;
if ( !songHasPlayed[randomNum] )
{
playRandomSong (songID);
songHasPlayed[randomNum] = true; // change to true so it is not picked again.
}
else
{
while (songHasPlayed[randomNum] )
randomNum = rand () % numSongs;
}
}
return 0;
}
void playRandomSong (int songID [numSongs] )
{
return;
}