سلام من با ویژال سی پلاس پلاس کار می کنم ولی وقتی برنامه رو میخوام اجرا کنم این error رو میده
Error 7 error C2065: 'cin' : undeclared identifier
من از using namespase std; هم استفاده کردم بازم درست نشد لطفا راهنمایی کنید
ممنون میشم
سلام من با ویژال سی پلاس پلاس کار می کنم ولی وقتی برنامه رو میخوام اجرا کنم این error رو میده
Error 7 error C2065: 'cin' : undeclared identifier
من از using namespase std; هم استفاده کردم بازم درست نشد لطفا راهنمایی کنید
ممنون میشم
سلام
میشه کد برنامه رو هم بزارین.
\\class.h
class Analyz
{
public :
void natije();
};
\\class.cpp
#include <iostream.h>
#include "stdafx.h"
#include "class.h"
using namespace std;
using std::cout;
using std::cin;
void Analyz::natije()
{
int pas=0;
int fild=0;
int natij;
int count=1;
while (count<=10)
{
cout <<"1 ya 2";
cin >>natij;
if(natij==1)
pas++;
else
fild++;
count++;
}
if (pas>=8)
cout<<"good";
}
\\analyz.cpp
#include "stdafx.h"
#include "class.h"
int _tmain(int argc, _TCHAR* argv[])
{
Analyz A1;
A1.natije();
return 0;
}
برنامه شامل یک کلاس میشه
البته قبلا من خودم یه بار حلش کردم اما حلا یادم نمیاد چکار کردم
ممنون میشم اگه کمک کنید
سلام دوباره
#include "stdafx.h"
#include"iostream"
using namespace std;
//class.h
class Analyz
{
public :
void natije();
};
//class.cpp
void Analyz::natije()
{
int pas=0;
int fild=0;
int natij;
int count=1;
while (count<=10)
{
cout <<"1 ya 2 : ";
cin >>natij;
if(natij==1)
pas++;
else
fild++;
count++;
}
if (pas>=8)
cout<<"good";
if(fild>=8)
cout<<"not good";
}
int _tmain(int argc, _TCHAR* argv[])
{
Analyz A1;
A1.natije();
int wait=0;
cin>>wait;
return 0;
}
این برنامه چرا اچرا نمیشه در حالی که با کامپایلر های دیگه انچام میشه من یه تازه کارم نه صفر ولی اصلااز visual C++ express edition 2008 سر در نمیارم کداش فرقه یا... کلا یکی منو کمک کنه#include "stdafx.h"
#include"iostream"
int main()
{
cout <<"please help";
return 0;
}
سلام
من الان کامپایل کردم و اجرا شد.
#include "stdafx.h"
#include"iostream"
using namespace std;
int main()
{
cout <<"please help";
int wait=0;
cin>>wait;
return 0;
}