I have include<stdio.h>, why it show that [Error] 'getline' was not declared in this scope ?
what should I do? Thank you!
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void read_input(InputBuffer* input_buffer) {
ssize_t bytes_read =
getline(&(input_buffer->buffer), &(input_buffer->buffer_length), stdin);//this line show error
if (bytes_read <= 0) {
printf("Error reading input\n");
exit(EXIT_FAILURE);
}
input_buffer->input_length = bytes_read - 1;
input_buffer->buffer[bytes_read - 1] = 0;
}