I am completely new to c++ and dont understand why this program wont let me put in any data. I looked around and I believe I need to use arrays and pointers but I dont understand why or how to use them. My code follows and I would appreciate some help in understanding what I should do. thanks. (what I am trying to do is enter in the info and read it into a file)
#include <fstream>
#include <iostream>
using namespace std;
/**************************************************************
* getName
* Prompt for file name
* Get name
* Return name
* End
****************************************************/
char getName()
{
char name;
cout << "What is the filename of the grades file? ";
* Prompt number of records
* Get records
* Return records
* End
*********************************************************/
int getNumberOfRecords()
{
int records;
cout << "How many records are in the file? ";
cin >> records;
cout << endl;
return records;
}
/*************************************************************
* getRecordName
* Prompt recordName
* Get recordName
* Return recordName
* End
**************************************************************/
char getRecordName()
{
char recordName;
* Prompt points
* Get points
* Return points
* End
***********************************************************/
int getPoints()
{
int points;
cout << "Points possible: ";
cin >> points;
cout<< endl;
return points;
}
/***********************************************************
* getScore
* Prompt score
* Get score
* Return score
* End
************************************************************/
int getScore()
{
int score;
* Read fileName
* Compare true or false
* For data = 0; data < records; data++
* Send recordName
* Send points
* Send score
* Compare true or false
* End
*************************************************************/
int readFile(char name,
int records,
char recordName,
int points,
int score
)
{
ifstream fin("name");
{
if (fin.fail())
return -1;
for (int data = 0; data < records; data++)
{
fin >> recordName
>> points
>> score;
if (fin.fail())
return -1;
}
}
fin.close();
}
/**********************************************************************
*
***********************************************************************/
int main()
{
char name;
int records;
char recordName;
int points;
int score;
records = getNumberOfRecords();
name = getName();
recordName = getRecordName();
points = getPoints();
score = getScore();