如何手动将turbo c ++头文件添加到dev c ++我知道其中一些已经包含但是像process.h和windows.h头文件不包括在内可以帮助很快帮助
#include <iostream>
#include <conio.h>
#include <dos.h>
#include <string.h>
#include <fstream>
#include <process.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <windows.h>
我在许多项目中都看到了gotoxy功能,但无法找到其定义原因?当它在dev c ++中使用时,它总是会出错
[错误]&#39; gotoxy&#39;未在此范围内声明
有人可以提供帮助吗?
答案 0 :(得分:4)
gotoxy()
函数和conio.h
不是标准函数/标题,不推荐使用。在Windows中,您可以根据SetConsoleCursorPosition()函数替换/重新实现gotoxy
(在Linux上,您应该使用ncurses库,而不是这种控制台I / O)。
this forum on cprogramming.com中列出了如何执行此操作的示例:
void gotoxy(int x, int y) {
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
(也许您应该通知您的教师,以便他们停止发布任何假设某些标题/功能在任何现代安装中不再可用的作业/示例。)