请问各位标准C怎样设置控制台光标位置
请问各位:标准C怎样设置控制台光标位置(只能用ASCII函数)
随意设?好像没有吧
WINAPI不要,
你自己编函数吧
用退格符,换行符进行控制
' ', \n
C/C++ code:
//This will set the position of the cursor
void gotoXY(int x, int y)
{
//Initialize the coordinates
COORD coord = {x, y};
//Set the position
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
return;
}
完整例子
C/C++ code
#include <windows.h>
#include <stdio.h>
void ConPrint(char *CharBuffer, int len);
void ConPrintAt(int x, int y, char *CharBuffer, int len);
void gotoXY(int x, int y);
void ClearConsole(void);
void ClearConsoleToColors(int ForgC, int BackC);
void SetColorAndBackground(int ForgC, int BackC);
void SetColor(int ForgC);
void HideTheCursor(void);
void ShowTheCursor(void);
int main(int argc, char* argv[])
{
HideTheCursor();
ClearConsoleToColors(15, 1);
ClearConsole();
gotoXY(1, 1);
SetColor(14);
printf("This is a test...\n");
Sleep(500);
ShowTheCursor();
SetColorAndBackground(15, 12);
ConPrint("
相关问答:
问一下:
#include <stdio.h>
int main()
{
char x, y, z;
int i;
int a[16];
for(i=0; i<=16; i++)
{
a[i] = 0;
......
两个文件1.PC,1.inc
1.PC有操作oracle数据库的 ,1.inc也有操作oracle数据库
在其他数据中如informix 中$include 1.inc就可以使用了
在ORACLE数据库重 $include 1.inc不可用 EXEC SQL include 1.inc也不可 ......
以前学过谭浩强的书,认真看过几遍,书上的题大部分自己编过,现在想进一步学习C,应该从哪方面着手呢?我准备看C与指针,大家觉得这本书怎么样?还是看其它的书?
你应该重新找《c primer plus》这本书看看。
c ......
我这里有一个登陆WIFI网络的页面。由于WIFI经常断线,所以要反复地在这个网页上登陆,没法无人值守。
所以,我想做一个C#程序,放一个webbrowser控件,自动填表并自动点击提交按钮。
问题一:
基本照网上找的程序 ......
void guibing(int a[],int n)
{
}
我已经初始化了一个数组a[30000]且赋值,想对这个数组进行归并排序。
但是具体怎么实现还是不知道。求源码
比如说。先一个一个排序,然后再将排序好的两个两个排序。那么这个排 ......