void digcom()
{
string ans;
int *score;
score = new int; // dynamic memory allocation
if ( score == NULL )
{
cerr << "insufitient space could not allocate memory" << endl;
exit ( 1 );
}
string questions[10] = {"State the basic form of representation of a image", "What does LAN stand for", "What type of data transmission allows data to only flow in one direction", "in a wireless network data is transmitted at the speed of __", "which is___", "determine the propagation delay associated with a connectionless communication channel through a private telephone network", "What does modem stand for", "what does IP stand for", "what format is used to store data"};
string answers[10] = {"pixels", "Local Area Network", "simplex", "light,5*10^-8", "5*10^-6", "modulator-demodulator", "Internet Protocol", "digital format"};
string store[10];
cout << "MAKE SURE THAT UR ANSWERS ARE IN SMALL LETTER UNLESS STATING THE ABBREVIATION" << endl;
*score = 0;
for ( int n = 0; n < 9; n++ )
{
cout << questions[n] << endl;
getline ( cin, ans );
int f = ans.length();
store[n] = ans.substr ( 0, f ); // string function
}
for ( int i = 0; i < 10; i++ )
{
if ( answers[i] == store[i] )
{
*score++; // pointer is incremented possible use before definition
}
}
cout << "you got " << *score << "/10" << endl;
delete score;
menu();
} // end of this function