hi,
please helpe me my code include one problem and i dont know how to slovet
the heder
#ifndef COURSE_H_
#define COURSE_H_
#include <iostream>
using namespace std;
#include<string>
using namespace std;
class Course
{
private:
string id;
int NumberOfCredits;
static string serialId;
public:
Course(string corsename)
{
}
void print()
{
}
};
#endif/*COURSE_H_*/
the.cpp
#include"a.h"
int serialId=001;
Course::Course(int numberofcridet)
{
NumberOfCredits=numberofcridet;
serialId++;
std::stringstream ss;
ss <<Cs <<ID;
id= ss.str();
}
void Course::print()
{
cout<<"The name of course is:\n"<<corsename;
cout<<"The Id of course is:\n"<<id;
cout<<"The number of cridet is:"<<numberofcredits<<endl;
}
the main
#include"a.h"
int main()
{
Course CourseObj(4);
CourseObj.print();
return 0;
}
i hope helpe me:(
-------------------
Compiling...
amain.cpp
c:\course new\amain.cpp(6) : error C2664: '__thiscall Course::Course(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)' : cannot convert parameter 1 from 'const int' to 'class std::basic_string<char,struct std:
:char_traits<char>,class std::allocator<char> >'
No constructor could take the source type, or constructor overload resolution was ambiguous
Error executing cl.exe.
amain.obj - 1 error(s), 0 warning(s)