- Kod: Zaznacz cały
myLan: 1
name: Leszczyny
myLan: 2
name: Czarwionka
Poniższym kodę próbuję pobrać dane z pliku, a dalej za pomocą modyfikatorów klasy myLan ustawić wartości.
- Kod: Zaznacz cały
char line[ MAX_WIDTH ];
int i = 0;
while( fgets( line, MAX_WIDTH, fp ) != NULL )
{
char charText[ MAX_WIDTH ];
sprintf(charText, "%s", line);
String stringText = charText;
stringText.Delete(1, 7);
if(i == 0)
{
int x = StrToInt(stringText);
myLan::setId(x);
}
if(i == 1)
{
//sprintf(charText, "%s", stringText.c_str());
//myLan::setName(charText);
//i = -1;
}
i++;
}
fclose( fp );