can anyone tell me where is my problem ???
i cannot debug this program.

--------------------------------------------------------------------

#include<iostream>
#include<string>
using namespace std;

class student
{
private :
    string name;
    int id;
    float cgpa;

public :
    void setName(string na);
    void setID(int number);
    void setCGPA(float result);
    string getName();
    int getID();
    float getCGPA();
    void display();
};

void student::setName(string na)
{ name = na; }

void student::setID(int number)
{ id = number; }

void student::setCGPA(float result)
{ cgpa = result; }

string student::getName()
{ return name; }

int student::getID()
{ return id; }

float student :: getCGPA()
{ return cgpa; }

void student:: display()
{
    cout<<"Name : "<<name
        <<"\nID : "<<id
        <<"\nCGPA : "<<cgpa<<endl;
}


student::student()
{
    name = "xxx";
    id = 0;
    cgpa = 1;
}




int main()
{
    student stuA;
    stuA.display();


    system("pause");

    return 0;
}

Define & declare the constructor within class.

public :
    student()
    {
        name = "xxx";
        id = 0;
        cgpa = 1;
    }
    void setName(string na);
    .....
    ....
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.