English 中文(简体)
每一行各有误,一行使用<<>
原标题:getting error in every line i have used <<

C2784的错误: st: stream-ostream<_Elem,_Traits> &std:operator <&td:basic_ostream<_Elem,_Traits> &,const :basic_string<_Elem,_Traits,_Alloc> &) :>could not ded. 模版:basic_o&documents;_E,_lem_Tracts&.

《刑法》规定:

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include "Pacient.h"

using namespace std;

void ruajKartele(Pacient patient)
{
    int mosha;
    char gjinia;
    string foo=patient.getEmer();
    string skedar=foo;
    ofstream file;
    file.open(skedar, ios::app);
    skedar<<foo+"
";
    mosha=patient.getMosha();
    gjinia=patient.getGjinia();
    foo=patient.getDiagnoza();
    skedar<<mosha<<"
"<<gjinia<<"
"<<foo<<"
";
    foo=patient.getPrognoza();
    skedar<<foo+"
";
    skedar<<"-----
"; //5
    skedar.close();
}
int _tmain(int argc, _TCHAR* argv[])
{
    return 0;
}
//Pacient structure:
    #include <string>
class Pacient
{
protected:
    std::string emer;
    int mosha;
    char gjinia;
    std::string diagnoza;
    std::string prognoza;

public:
    Pacient(void);
~Pacient(void);
void setEmer(std::string);
void setMosha (int);
void setGjinia(char);
void setDiagnoza(std::string);
void setPrognoza(std::string);
std::string getEmer(void);
int getMosha(void);
char getGjinia(void);
std::string getDiagnoza(void);
std::string getPrognoza(void);
};
最佳回答
string skedar=foo;
ofstream file;
file.open(skedar, ios::app);
skedar<<foo+"
";

<代码>skedar为std:string,(明显)为一条途径。 。 如果你想写这段话,你可以打上<条码>skedar <<“whatever”;,你需要向<条码>输出:

file << foo << "
";

Same for skedar.close();: it sfile You想要关闭,而不是代表其档案名称的说明。

问题回答

You ve使用了“带”;“设计”;“动脉”的操作者。 浏览器没有“带”;操作器。 也许,你打算使用这样的东西:

file<<skedar<<mosha<<"
"<<gjinia<<"
"<<foo<<"
";

我还注意到:

skedar.close();

不这样做:

file.close();

我只想补充一点。





相关问题
how to reliable capture display setting changed

static void Main() { // Set the SystemEvents class to receive event notification when a user // when display settings change. SystemEvents.DisplaySettingsChanged += new ...

Why use CComBSTR instead of just passing a WCHAR*?

I m new to COM. What exactly is the advantage of replacing: L"String" with CComBSTR(L"String") I can see a changelist in the COM part of my .NET application where all strings are replaced in this ...

COM Basic links

folks can you provide me the tutorial link or .pdf for learning basic COM?. i do google it.. still i recommend answers of stackoverflow so please pass me.. Thanks

Statically linking Winsock?

I m using Winsock 1.1 in my project. I include wsock32.lib in "Additional Dependencies". I m looking at the DLL project using depends.exe and notice that the DLL depends on wsock32.dll. How can I ...

热门标签