关于结构体COORD介绍
2024-08-30 03:04:45
COORD是windows API中定义的一种结构,表示一个字符在控制台屏幕上的坐标。其定义为:
typedef struct _COORD {
SHORT X; // horizontal coordinate
SHORT Y; // vertical coordinate
} COORD;
表示一个字符在控制台屏幕上的坐标。
应用
c++中的例子:
#include <iostream>
#include <Windows.h>
using namespace std;
void gotoxy(int x,int y)
{
COORD loc={x,y};
HANDLE hOutput=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOutput,loc);
}
int main()
{
gotoxy(,);
cout<<"Hello World!"<<endl;
system("pause");
return ;
}
输出
说明:字符前有来个空格
最新文章
- spider 配置文件参考
- JQuery常用函数及功能小结
- iPhone4下window各个部分的高度
- 无法更新 EntitySet“SoreInfo_Table”,因为它有一个 DefiningQuery,而 <;ModificationFunctionMapping>; 元素中没有支持当前操作的 <;InsertFunction>; 元素。
- BZOJ4117 : [Wf2015]Weather Report
- .net程序集强命名(签名)
- (转)Fibonacci Tilings
- 暂时解决Sublime Text 2不支持input问题(转)
- 前端基础系列——CSS规范(文章内容为转载)
- csv操作帮助类
- SDOI HH的项链 HEOI采花
- linux vi 中s 替换方法
- IIS怎么设置本地域名解析(本地域名测试配置)
- JSP 页面传值方法总结
- qt pro 设置编译参数,支持 xp
- pip改源
- 程序连接oracle数据库问题Cannot create PoolableConnectionFactory ...
- laravel视图$errors为空
- android--获取屏幕高宽度工具类
- Linux下软件包安装
热门文章
- Draw the RGB data from kinect C++ via opengl
- Java中AtomicInteger的使用!!!
- hdoj--1034--Hidden String(dfs)
- string类自定义字符串替换函数replace
- sql阻塞进程查询
- Android Retrofit网络请求Service,@Path、@Query、@QueryMap、@Map...
- mybatis集成到spring理解
- Conventions and patterns for multi-platform development
- noip 2018 day1 T2 货币系统 完全背包
- 最新华为数通HCNP-随堂培训视频课程 大牛讲解高清带实验