[ create a new paste ] login | about

Link: http://codepad.org/NZyJD8Vi    [ raw code | output | fork ]

C, pasted on May 26:
#ifndef STUDENT_H
#define STUDENT_H
#include "defines.h"
#include <iostream>
#include <cstring>

class CStudent
{
    double m_dGPA;
    char *m_pName;
    int m_nID;

public:

    CStudent();
    CStudent(const CStudent& input);
    CStudent(double GPA);
    ~CStudent();

    double GetGPA();
    void SetName(const char *pName){strcpy(m_pName, pName);}
    void GetName(char *pName) {strcpy(pName, m_pName);}
    void SetID(int nID);

    int GetID() {return m_nID;};
    void SetGPA(double input) {m_dGPA = input;};

    CStudent& operator=(const CStudent& rhs);

    friend std::ostream& operator<<(std::ostream& os,
                               const CStudent& input);
    friend std::istream& operator>>(std::istream& is, CStudent &input);

    friend bool operator==(const CStudent& lhs, const CStudent &rhs);
    friend bool operator!=(const CStudent& lhs, const CStudent &rhs);
};

inline double CStudent::GetGPA()
{
    return m_dGPA;
} 

inline void CStudent::SetID(int nID)
{
    m_nID = nID;
} 

#endif


Output:
1
2
3
4
5
6
Line 20: error: defines.h: No such file or directory
Line 19: error: iostream: No such file or directory
Line 18: error: cstring: No such file or directory
Line 7: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CStudent'
Line 38: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
Line 43: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token


Create a new paste based on this one


Comments: