No tiedän, ettei tätä olisi tänne kannattanut laittaa mutta pistinpähän, kun tässä on joku bugi, jota en löydä...
#include <iostream.h>
#include <go32.h>
#include <sys/farptr.h>
#include <time.h>
#include <stdlib.h>
#include <conio.h>
#include <dos.h>
#include <stdio.h> //File ainakin tarttee tämän
#include <string.h> //c++ vaatii tämän, c ei?
char kirjain[7,7,255];
void FonttiMuistiin();
void main()
{
FonttiMuistiin(); //otetaan fontit muistiin...
for (int y=0;y<8;y++)
{
for (int x=0;x<8;x++)
{
cout << kirjain[x,y,1] << endl; //... mutta kaikki on nollaa!
}
getch();
}
}
void FonttiMuistiin()
{
char tavu;
FILE *tiedosto=fopen("fontti.txt", "rb"); //r=10, rb=13
for (int asciikoodi=0; asciikoodi<256; asciikoodi++)
{
for (int y=0; y<8; y++)
{
for (int x=0; x<8; x++)
{
tavu=fgetc(tiedosto);
tavu=fgetc(tiedosto);
kirjain[x,y,asciikoodi]=tavu;
tavu=fgetc(tiedosto);
}
}
}
fclose(tiedosto);
}Tähän tarvittaisiin vielä fontti.txt -tiedosto, mutta tästä kai pitäisi jo se bugi näkyä... Tämä siis tallentaa taulukkoon fontit, muttei niitä main-funktiossa enää ole?!?
Aihe on jo aika vanha, joten et voi enää vastata siihen.