我很想知道如何实现std :: string以及它与c字符串的区别?如果标准没有指定任何实现,那么任何带有解释的实现都会很好,它如何满足标准给出的字符串要求?
我不能在类中使用这些指针变量在文件上写数据.程序中没有错误,但文件上没有写入数据.请有人告诉我,我做错了什么.
#include <iostream.h>
#include <fstream.h>
class studentinfo
{
private:/*Creating Private Data Members */
char* VUID;
char* campusID;
char* Studentname;
char* Fathername;
public:
void Storefile();/* Function to Store Data in the File*/
char Display();/*Function to Read and then Display Data from the File*/
studentinfo(char*, char*, char*, char*);/*Constructor to initialize Data Members*/
~studentinfo();
};
/* Constructor Defined Here*/
studentinfo::studentinfo(char* VUID, char* campusID, char* Studentname, char* Fathername)
{
cout << "Parameterized Contructor is Called" << endl << endl;
}
/*Destructor Defined Here*/
studentinfo::~studentinfo() …
Run Code Online (Sandbox Code Playgroud)