16
সি লাইনে ফাইল লাইন পড়ুন
আমি এই ফাংশনটি একটি ফাইল থেকে একটি লাইন পড়তে লিখেছি: const char *readLine(FILE *file) { if (file == NULL) { printf("Error: file pointer is null."); exit(1); } int maximumLineLength = 128; char *lineBuffer = (char *)malloc(sizeof(char) * maximumLineLength); if (lineBuffer == NULL) { printf("Error allocating memory for line buffer."); exit(1); …