相关疑难解决方法(0)

如何实现std :: string?

我很想知道如何实现std :: string以及它与c字符串的区别?如果标准没有指定任何实现,那么任何带有解释的实现都会很好,它如何满足标准给出的字符串要求?

c++ string std cstring

53
推荐指数
4
解决办法
5万
查看次数

无法在文件中写入数据,程序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)

c++ pointers file-handling

4
推荐指数
1
解决办法
431
查看次数

标签 统计

c++ ×2

cstring ×1

file-handling ×1

pointers ×1

std ×1

string ×1