You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
implicit declaration of function 'getline'; did you mean 'getenv'? [-Wimplicit-function-declaration]gcc
"I encountered this issue on Windows 10 and found that this function may not work on Windows. So, I tried running the same code under WSL and it worked successfully.
You can try to implement this function by yourself on windows.
`ssize_t getline(char **linep, size_t *n, FILE *fp)
{
int ch;
size_t i = 0;
if (!linep || !n || !fp)
{
return -1;
}
if (*linep == NULL)
{
if (NULL == (*linep = malloc(*n = 128)))
{
*n = 0;
return -1;
}
}
implicit declaration of function 'getline'; did you mean 'getenv'? [-Wimplicit-function-declaration]gcc
The text was updated successfully, but these errors were encountered: