Hi guyz,
Is it possible to create objects of a class whose
definition as well as declaration is not available in advance?
Consider the following program:
#include<iostream>
#include<fstream>
#include "abc.cpp" /*this contains class def. which is not available in
advance, but will have some definition later on .This will be
provided by the user and will be copied there(by opening
abc.cpp,copying the class defn. and closing it)
Now is it possible to create an object of this class in the main
program??*/
using namespace std;
int main()
{
//some code which will prompt user to enter class defn
//the defn. will be copied to abc.cpp
//say the user provided some class defn. like class student{ ...};
// How to create objects of that particular class i.e. student s;
return 0;
}
Note:It is assumed that user has provide a perfect error free class
definition.
bye,
ben