Results 1 to 3 of 3

Thread: ใครที่เคยใช้ visual c++ ช่วยเข้ามาดูให้หน่อยครับ พอดีเขียนโป

  1. #1
    Tony
    Guest


    ใครที่เคยใช้ visual c++ ช่วยเข้ามาดูให้หน่อยครับ พอดีเขียนโป

    ผมเขียนใน Microsoft Visual C++6.0 ครับแต่เขียนเป็นภาษาซีโปรแกรมผมจะเป็น เช่น Test.c ตอนผมเขียนโปรแกรมธรรมดา ที่ใช้แค่ #include "stdio.h" ก็ complie ได้ปกติครับ แต่พอเขียนโปรแกรมที่ ต้องใช้ getch,clrscr, ดังตัวอย่างละครับ ทำไมไม่ผ่าน ต้องแก้ไขอย่างไรครับ รบกันผู้รู้แนะนำด้วยนะครับ ว่ามันเกิดจากอะไร แก้อย่างไรครับ
    #include "stdio.h"
    #include "conio.h"
    void main()
    {
    char ch;
    clrscr();

    printf("Enter Charactern:");
    ch=getch();
    printf("nDisplay%c",ch);

    getch();
    }
    ส่วนที่ฟ้อง error ครับ

    --------------------Configuration: to - Win32 Debug--------------------
    Linking...
    to.obj : error LNK2001: unresolved external symbol _clrscr
    Debug/to.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    to.exe - 2 error(s), 0 warning(s)

  2. #2
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    Re: ใครที่เคยใช้ visual c++ ช่วยเข้ามาดูให้หน่อยครับ พอดีเขี

    [src]
    #include < stdio.h >
    #include < conio.h > //need for system();
    #include < stdlib.h > //need for system();

    int main()
    {
    system("cls"); // ใน windows ใช้คำสั้งนี้แทน clrscr()
    printf("hello worldn");

    }
    [/src]

  3. #3
    Anonymous
    Guest


    Re: ใครที่เคยใช้ visual c++ ช่วยเข้ามาดูให้หน่อยครับ พอดีเขี

    standard C runtime library ใน VC++ ไม่มีฟังก์ชันเหล่านี้อีกต่อไปแล้วคับ เช่นพวกฟังก์ชัน clrscr(), textcolor() และอื่นๆ ซึ่งเคยเป็นฟังก์ชันที่เคยมีอยู่ใน compiler ตัวอื่น เช่น Turbo C

    ฟังก์ชันเหล่านี้ (โดยเฉพาะที่ประกาศอยู่ใน conio.h) ไม่เป็นไปตามมาตรฐาน ANSI/ISO C/C++ ด้วยครับ หากใช้ก็ต้องระวังเรื่อง compatibility ด้วยคับผม

Similar Threads

  1. เขียนโปรแกรมด้วย Visual C++ 6.0
    By arsarawut in forum C/C++,C#,VC++,MFC,Win32
    Replies: 0
    Last Post: 28-11-2008, 09:55 PM
  2. Visual Basic 6.0 (ไทย )
    By 5h4d0wm4n in forum E-Book, Video หรือบทความทั่วไปด้าน Computer
    Replies: 0
    Last Post: 07-06-2008, 04:09 PM
  3. Visual Basic 6.0
    By openone in forum Window Application
    Replies: 0
    Last Post: 02-09-2007, 05:38 PM
  4. Visual C++ 6.0 Pro
    By suttijit in forum Window Application
    Replies: 2
    Last Post: 15-07-2007, 10:48 PM
  5. visual c++.net
    By nick69816 in forum C/C++,C#,VC++,MFC,Win32
    Replies: 1
    Last Post: 14-07-2007, 06:16 AM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •