Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8070489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:24:38+00:00 2026-06-05T13:24:38+00:00

#include<iostream> using namespace std; class StudentClass{ friend class Oopclass; public: StudentClass(); void setStudentData(); void

  • 0
#include<iostream>
using namespace std;

class StudentClass{
friend class Oopclass;
public:
    StudentClass();
    void setStudentData();
    void printStudentScore();
    StudentClass* next;
    ~StudentClass();
private:
    string std_ID;
    int sID, sMid, sFin, sOP, hw[3];   
    double sTotal; 

};

class OopClass{
friend class StudentClass;
public:
    OopClass();
    void setOopData();
    void printOopScore();
    void queryOopScore();
    void findOopAverageScore();
    void addStudentData();
    void deleteStudentData();
    void updateStudentData();
    ~OopClass();
private:
    string professor, subject;
    int cSn;
    double cSAvg;
    StudentClass* cSAddr;
};

int main(int argc, char **argv){
OopClass Info[3];
Info[0].setOopData();
return 0;
}

StudentClass::StudentClass(){
}
void StudentClass(){
}
void StudentClass::setStudentData() {

}
StudentClass::~StudentClass(){
}
OopClass::OopClass(){
}
void OopClass::setOopData() {
cout << "Professor?" << endl;
cin >> professor;
cout << "Subject?" << endl;
cin >> subject; 
cout << "How many students do you want to input ?" << endl;
int number = 0;
cin >> number;
cSAddr = new StudentClass;
//for(int i = 0; i < number; i ++) setStudentData();

}
OopClass::~OopClass(){
}

When I tired to write “cSAddr = new StudentClass;” ,it come up to

error about

” C:\Users\lypan\Documents\final.cpp In member function ‘void
OopClass::setOopData()’:

63 14 C:\Users\lypan\Documents\final.cpp [Error] expected
type-specifier before ‘StudentClass’

63 14 C:\Users\lypan\Documents\final.cpp [Error] invalid conversion
from ‘int*’ to ‘int’ [-fpermissive]

63 14 C:\Users\lypan\Documents\final.cpp [Error] expected ‘,’ or ‘;’
before ‘StudentClass’ “

And I have no idea why I do wrong, please tell me what I make mistake. Thx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:24:39+00:00Added an answer on June 5, 2026 at 1:24 pm

    The only error here is that you didn’t implement the constructors for your classes. But that should yield a linker error.

    This probably isn’t your code, but it might be that you don’t include StudentClass.h and OopClass.h (or whatever) in the file where you define OopClass::setOopData().

    EDIT:

    void StudentClass()
    

    you declare a function called StudentClass on line 46 – http://codepad.org/9DP6zpHU – you probably forgot to qualify it.

    StudentClass::StudentClass(){
    }
    //THIS!
    void StudentClass(){
    }
    void StudentClass::setStudentData() {
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include<iostream> using namespace std; class A { private: const int a=9; public: void display()
Consider this code: #include <iostream> using namespace std; class hello{ public: void f(){ cout<<f<<endl;
#include<iostream> using namespace std; class Abs { public: virtual void hi()=0; }; class B:public
#include<iostream> using namespace std; class A { }; class B { public: void disp()
#include<iostream> using namespace std; class A { int a; int b; public: void eat()
#include iostream using namespace std; class A { public: void mprint() { cout<<\n TESTING
include stdafx.h #include <iostream> using namespace std; class Foo{ public: void func() { cout<<Hello!!<<endl;
#include <iostream> using namespace std; typedef void (*pFun)(void); class A { private: int a;
#include <iostream> #include <vector> using namespace std; class Parent { public: Parent(); void method();
#include<iostream> using namespace std; class base { public: virtual void add() { cout <<

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.