Code:
void FileRead(const char* FilePath) {
auto char line[200];
auto int LineCount = 1;
auto FILE *fp;
if((fp = fopen(FilePath, "rb"))==NULL) { printf("%s does not exist!", FilePath);
} else {
printf("\n\nNow Opening: %s\n", FilePath);
while ( fgets(line, sizeof line, fp) != NULL)
{
LineCount++;
//printf("%i: %s",LineCount,line);
}
}
}
Someone could look over that real quick and see if thats an efficient way to assign each line in the file, a value inside the LineCount? Thatd be great...
Code:
ImageSAtr ImageSettings[19] = {
{6, 74, 115, 98}, // FILLERers c
{0, 0, 480, 272}, // backround c
{160, 60, 272, 116}, // logo c
{208, 216, 48, 48}, // play c
{208, 216, 48, 48}, // PAUSE c
{115, 233, 13, 13}, // stop c
{83, 4, 93, 26}, // Now playing ModeNum c
{321, 4, 64, 26}, // Option ModeNum c
{212, 4, 64, 26}, // Browser ModeNum c
{43, 5, 25, 25}, // Next Visual c
{15, 5, 25, 25}, // previous visual c
{270, 231, 14, 15}, // Forward
{182, 230, 14, 15}, // Rewind
{156, 231, 17, 15}, // Previous Track
{292, 231, 17, 15}, // Next Track
{340, 231, 17, 16}, // Repeat On
{434, 40, 43, 18}, // EXIT c
{217, 117, 1, 1} // cursor c
};
Im thinking of making an array of integers, and a new arra buffer... hmm...
Code:
int LineAndRow[500];
int y;
void FileRead(const char* FilePath) {
auto char line[MAX_MENU_ROWS];
int count = 0;
auto FILE *fp;
if((fp = fopen(FilePath, "rb"))==NULL) { printf("%s does not exist!", FilePath);
} else {
printf("\n\nNow Opening: %s\n", FilePath);
while ( fgets(line, sizeof line, fp) != NULL)
{
snprintf(LineAndRow[count],4, "%i", (atoi(line)));
printf(LineAndRow[count]);
count++;
}
}
}
Im using snprintf to prevent an over flow, and since the total MAX number of bytes to be used in a image dimension/coordinate is 3 bytes long... it works out, but i get a crask when running this... Anyone tell me whats wrong with what im trying to do and this?