哪里/如何获得“ getline”?如果stdio.h中缺少该功能? [英] Where/how to get the "getline" function if it is missing from stdio.h?

查看:163
本文介绍了哪里/如何获得“ getline”?如果stdio.h中缺少该功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 8上使用Code :: Blocks 13.12在C语言中编写程序(C编译器为mingw32-gcc)。我想使用 getline功能,但stdio.h中似乎缺少该功能。除了编写自己的实现,还有什么方法可以得到它?

I'm writing a program in C using Code::Blocks 13.12 on Windows 8 (the C compiler is mingw32-gcc). I would like to use the "getline" function but it seems to be missing from the stdio.h. Is there any way to get it except for writing own implementation?

推荐答案

getline 是POSIX函数,而Windows不是POSIX,因此它没有可用的POSIX C函数。

getline is a POSIX function, and Windows isn't POSIX, so it doesn't have some POSIX C functions available.

您需要自己滚动。或使用已已编写的

You'll need to roll your own. Or use one that has already been written.

这篇关于哪里/如何获得“ getline”?如果stdio.h中缺少该功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆