| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1761 人关注过本帖
标题:C语言真奇妙啊,还能这样玩
只看楼主 加入收藏
え元元え
Rank: 1
等 级:新手上路
帖 子:103
专家分:0
注 册:2006-4-7
收藏
得分:0 
什么啊````
和颜色有什么关系 ` ``
童虎
帮我解释下``

2006-04-08 00:52
feng1256
Rank: 4
等 级:贵宾
威 望:14
帖 子:2899
专家分:0
注 册:2005-11-24
收藏
得分:0 
你要给color 指定一个0-15的数字 代表15个颜色
或者直接给color一个颜色例如color=WHITE;

叁蓙大山:工謪、稅務、嗣發 抱歉:不回答女人的问题
2006-04-08 00:54
え元元え
Rank: 1
等 级:新手上路
帖 子:103
专家分:0
注 册:2006-4-7
收藏
得分:0 

可我是这样把他全打出来的:

#include<conio.h>
#include<stdio.h>

void main(void)
{
int color=0;
for(color=0;color<8;color++)
{
textbackground(color);
cprintf("This is color %d\r\n",color);
cprintf("Press any key to continue\r\n");
getch();
}
}

他老报错
error C2065: 'textbackground' : undeclared identifier
这个错


2006-04-08 00:57
feng1256
Rank: 4
等 级:贵宾
威 望:14
帖 子:2899
专家分:0
注 册:2005-11-24
收藏
得分:0 
可能是你的编译器里的textbackground(color);头文件你没包含
或者是在你的编译器里设置背景颜色的函数和这个名字不同

叁蓙大山:工謪、稅務、嗣發 抱歉:不回答女人的问题
2006-04-08 01:02
え元元え
Rank: 1
等 级:新手上路
帖 子:103
专家分:0
注 册:2006-4-7
收藏
得分:0 
是在#include<conio.h>这个中吗``???
怎么加上去啊````
我想要颜色``

2006-04-08 01:04
feng1256
Rank: 4
等 级:贵宾
威 望:14
帖 子:2899
专家分:0
注 册:2005-11-24
收藏
得分:0 

你自己查查你编译器的include 文件


叁蓙大山:工謪、稅務、嗣發 抱歉:不回答女人的问题
2006-04-08 01:05
え元元え
Rank: 1
等 级:新手上路
帖 子:103
专家分:0
注 册:2006-4-7
收藏
得分:0 

/***
*conio.h - console and port I/O declarations
*
* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
* This include file contains the function declarations for
* the MS C V2.03 compatible console I/O routines.
*
* [Public]
*
****/

#if _MSC_VER > 1000
#pragma once
#endif

#ifndef _INC_CONIO
#define _INC_CONIO

#if !defined(_WIN32) && !defined(_MAC)
#error ERROR: Only Mac or Win32 targets supported!
#endif


#ifndef _MAC

#ifdef __cplusplus
extern "C" {
#endif

/* Define _CRTIMP */

#ifndef _CRTIMP
#ifdef _DLL
#define _CRTIMP __declspec(dllimport)
#else /* ndef _DLL */
#define _CRTIMP
#endif /* _DLL */
#endif /* _CRTIMP */


/* Define __cdecl for non-Microsoft compilers */

#if ( !defined(_MSC_VER) && !defined(__cdecl) )
#define __cdecl
#endif

/* Define _CRTAPI1 (for compatibility with the NT SDK) */

#ifndef _CRTAPI1
#if _MSC_VER >= 800 && _M_IX86 >= 300
#define _CRTAPI1 __cdecl
#else
#define _CRTAPI1
#endif
#endif

/* Function prototypes */

_CRTIMP char * __cdecl _cgets(char *);
_CRTIMP int __cdecl _cprintf(const char *, ...);
_CRTIMP int __cdecl _cputs(const char *);
_CRTIMP int __cdecl _cscanf(const char *, ...);
_CRTIMP int __cdecl _getch(void);
_CRTIMP int __cdecl _getche(void);
#ifdef _M_IX86
int __cdecl _inp(unsigned short);
unsigned short __cdecl _inpw(unsigned short);
unsigned long __cdecl _inpd(unsigned short);
#endif /* _M_IX86 */
_CRTIMP int __cdecl _kbhit(void);
#ifdef _M_IX86
int __cdecl _outp(unsigned short, int);
unsigned short __cdecl _outpw(unsigned short, unsigned short);
unsigned long __cdecl _outpd(unsigned short, unsigned long);
#endif /* _M_IX86 */
_CRTIMP int __cdecl _putch(int);
_CRTIMP int __cdecl _ungetch(int);


#if !__STDC__

/* Non-ANSI names for compatibility */

_CRTIMP char * __cdecl cgets(char *);
_CRTIMP int __cdecl cprintf(const char *, ...);
_CRTIMP int __cdecl cputs(const char *);
_CRTIMP int __cdecl cscanf(const char *, ...);
#ifdef _M_IX86
int __cdecl inp(unsigned short);
unsigned short __cdecl inpw(unsigned short);
#endif /* _M_IX86 */
_CRTIMP int __cdecl getch(void);
_CRTIMP int __cdecl getche(void);
_CRTIMP int __cdecl kbhit(void);
#ifdef _M_IX86
int __cdecl outp(unsigned short, int);
unsigned short __cdecl outpw(unsigned short, unsigned short);
#endif /* _M_IX86 */
_CRTIMP int __cdecl putch(int);
_CRTIMP int __cdecl ungetch(int);

#endif /* __STDC__ */

#ifdef __cplusplus
}
#endif

#endif /* _MAC */

#endif /* _INC_CONIO */
这是什么意思啊```
我不懂```
我要是女的你是不是告诉我啊`


2006-04-08 01:09
zb8275
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-4-8
收藏
得分:0 

阳光总在风雨后
2006-04-08 01:16
孤月
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-4-5
收藏
得分:0 
这个程序的运行是怎样的?

2006-04-08 01:24
え元元え
Rank: 1
等 级:新手上路
帖 子:103
专家分:0
注 册:2006-4-7
收藏
得分:0 
我没有头文件 ``

2006-04-08 01:34
快速回复:C语言真奇妙啊,还能这样玩
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017384 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved