楼主   #include <stdio.h>
#include <conio.h>main()
{
getch();
gotoxy(10,10);
printf("*");
}为什么在vc的环境下不能通过?? gotoxy()这个函数找不到
报错:
1.obj : error LNK2001: unresolved external symbol _gotoxy
Debug/t1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe. 

解决方案 »

  1.   

    这个好像只能在tc编译器下编译。c语言下面的。gotoxy()函数我好像记得前面得打开图形模式,具体函数忘记了,去查查c函数列表吧?要么就得#include <graphic.h>,我现在早就没有tc了,自己查查把
    我一般用#include <conio.h>时候主要就用clrscr()函数
      

  2.   

    vc下的conio.h中没有相应的gotoxy();这只在tc,bc中才有但可以自己构造一个如#include #include
    using namespace std;
    void gotoxy(int x, int y) {
    COORD c;
    c.X = x - 1;
    c.Y = y - 1;
    SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
    } int main()
    {
    gotoxy(20,12);
    std::cout<<"Hello world!"<return 0;
    }其中的COORD和SetConsoleCursorPosition定义在wincon.h上SetConsoleCursorPosition用于在相应的设备设置光标的位置,两个参数分别是设备句柄和光标位置结构GetStdHandle定义在winbase.h上用于获得标准输入、输出、错误输出句柄当参数标识为STD_OUTPUT_HANDLE时获得标准输出句柄
      

  3.   

    不为什么,这是TC下的函数,本来就不是标准C库里的。