Permission denied

hey guys I'm writing this program
and Im geting this stupig error:

Permission denied
ld returned 1 exit status


Here is the code:
thanks for any help

#include<iostream>
using namespace std;

class TestGrader
{ private:
char answers[20];

public:
void setKey(char[]);
void grade(char[]);
};




int main()
{ TestGrader drivingTest;
char rightAnswers[20] = {'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B',
'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A'};
char givenAnswers[20];
int index;
char choise;


drivingTest.setKey(rightAnswers);
do
{

for(index = 0; index < 20; index++)
{
char answer;
cout << "Enter answer given for question " << (index + 1) << " " << endl;
cin >> answer;
givenAnswers[index] = answer;
}



drivingTest.grade(givenAnswers);

cout << "Do you want to repeat the procedure?/n";
cin >> choise;
}while(choise == 'y' || choise == 'Y');

return 0;
}

//definition for function setKey()
//it takes as argument an array with the right answers
//and copies the information into his answers array
void TestGrader::setKey(char array[])
{
for(int index = 0;index < 20;index++)
{
answers[index] = array[index];
}
}

//definition of function grade()
//it takes an array with the given answers
//as argument
//and gives back the results of the exam
void TestGrader::grade(char array[])
{
int count = 0;
for(int index = 0;index< 20; index++)
{
if(array[index] != answers[index])
{ count++;
cout << "Answer " << (index + 1) << " is wrong.\n";
}
}

if(count > 5)
{
cout << "The person failed the test with " << count << " mistakes!\n";
}
else
cout << "The person passed the test with " << count << " mistakes!\n";


}
Please use [code][/code] tags.

Your program works just fine on my machine. Although I think you meant '\n' and not '/n' (in main()). Is this a compiler error? Or is the program closing with this error message?
Last edited on
that was the mistake...
thanks!
Topic archived. No new replies allowed.