| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 833 人关注过本帖
标题:有没有可以得到当前字符位置的函数啊
只看楼主 加入收藏
onlyll
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2008-9-16
收藏
 问题点数:0 回复次数:4 
有没有可以得到当前字符位置的函数啊
我用的是tc,想在适当的位置输出字符。
   但是用gotoxy之前我想先得到当前的坐标值,不知可不可以。
搜索更多相关主题的帖子: 函数 字符 位置 函数 字符 位置 
2008-10-09 14:44
守鹤
Rank: 4
来 自:山東臨沂
等 级:贵宾
威 望:12
帖 子:337
专家分:0
注 册:2008-6-20
收藏
得分:0 
我是不知道,但不知goxy是什么意思?

多少个日日夜夜想起你,只希望有缘再次相见
2008-10-09 14:50
onlyll
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2008-9-16
收藏
得分:0 
gotoxy函数
原型:void     gotoxy(int x, int y);
功能:将字符屏幕的光标移动到x,y所指定的位置。如果其中有一个坐标值无效,则光标不移动。
2008-10-09 14:55
netsolo
Rank: 1
等 级:新手上路
帖 子:122
专家分:0
注 册:2008-3-6
收藏
得分:0 
摘自TC帮助文件

 wherex, wherey                  <CONIO.H>

  wherex gives current horizontal cursor position
  wherey gives current vertical cursor position

 Declaration:
  int wherex(void);
  int wherey(void);

 Remarks:
wherex returns the x-coordinate of the current cursor position (within the
current text window).

wherey returns the y-coordinate of the current cursor position (within the
current text window).

 Return Value:
  wherex returns an integer in the range 1 to 80.
  wherey returns an integer in the range 1 to 25,
    1 to 43, or 1 to 50.

 Portability:
 DOS UNIX ANSI C C++ Only
 Yes                     

 See Also:
  gettextinfo   gotoxy

 Example:

 #include <conio.h>

 int main(void)
 {
    clrscr();
    gotoxy(10,10);
    cprintf("Current location is X: %d  Y: %d\r\n", wherex(), wherey());
    getch();

    return 0;
 }
2008-10-09 15:56
onlyll
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2008-9-16
收藏
得分:0 
哦 原来是这样  麻烦你了  
 非常感谢!!
2008-10-09 15:59
快速回复:有没有可以得到当前字符位置的函数啊
数据加载中...
 
   



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

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