- 论坛徽章:
- 0
|
各位好,我想在linux內用c編寫一個可以在console下顯示pixel的程式. 請指教.
還有一個問題, 當我運行以下程式時出現了錯誤,請各位指教. 謝謝.
#include <stdio.h>;
#include <alloc.h>;
#include <string.h>;
#include <dos.h>;
int main(void)
{
char far *fptr;
char *str = "Hello";
/* allocate memory for the far pointer */
fptr = farcalloc(10, sizeof(char));
/* copy "Hello" into allocated memory */
movedata(FP_SEG(str), FP_OFF(str),
FP_SEG(fptr), FP_OFF(fptr),
strlen(str));
/* display string (note the F modifier) */
printf("Far string is: %Fs\n", fptr);
/* free the memory */
farfree(fptr);
return 0;
} |
|