SS3
28-01-2009, 00:06
Хм... делаю вроде все правильно, как в учебнике написано:
// 18.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <conio>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a,b;
textcolor(RED);
cout << "Input two numbers:\n";
cin >> a;
cin >> b;
if (a>b)
cout << a <<">"<< b;
if (a<b)
cout << a << "<" << b;
if (a==b)
cout << a << "=" << b;
getchar();
return 0;
}
и тут начинает ругаться компилятор
1>------ Build started: Project: 18, Configuration: Debug Win32 ------ 1>Compiling...
1>18.cpp 1>c:\users\администратор\documents\visual studio 2008\projects\18\18\18.cpp(12) : error C2065: 'RED' : undeclared identifier
1>c:\users\администратор\documents\visual studio 2008\projects\18\18\18.cpp(12) : error C3861: 'textcolor': identifier not found
1>Build log was saved at "file://c:\Users\Администратор\Documents\Visual Studio 2008\Projects\18\18\Debug\BuildLog.htm"
1>18 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Скорее все тут я допустил какую-ту ошибку, так как еще мало практики, вот только какую?
Если, кому не лень, укажите мне что не так я делаю.
// 18.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <conio>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a,b;
textcolor(RED);
cout << "Input two numbers:\n";
cin >> a;
cin >> b;
if (a>b)
cout << a <<">"<< b;
if (a<b)
cout << a << "<" << b;
if (a==b)
cout << a << "=" << b;
getchar();
return 0;
}
и тут начинает ругаться компилятор
1>------ Build started: Project: 18, Configuration: Debug Win32 ------ 1>Compiling...
1>18.cpp 1>c:\users\администратор\documents\visual studio 2008\projects\18\18\18.cpp(12) : error C2065: 'RED' : undeclared identifier
1>c:\users\администратор\documents\visual studio 2008\projects\18\18\18.cpp(12) : error C3861: 'textcolor': identifier not found
1>Build log was saved at "file://c:\Users\Администратор\Documents\Visual Studio 2008\Projects\18\18\Debug\BuildLog.htm"
1>18 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Скорее все тут я допустил какую-ту ошибку, так как еще мало практики, вот только какую?
Если, кому не лень, укажите мне что не так я делаю.