Re: [Dev-C++] unresolved external/linker error
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2002-09-18 11:10:59
|
Forst of all, I didn't know that overload existed in C.
Second. Why write a new getline with - almost - the same function as
the already existing fgets?
Third. The sample code never terminates the loaded buffer after it finds z
newline character, or runs out of buffer space.
/Per W
On Wed, 18 Sep 2002, Carlos Garc=EDa del Monte wrote:
> Oh, yes, iostream is C++, I should have notice it, stdio has no getline.
> There are no C getline(), only C++, the one from iostream and the other w=
hich come
> from string and the other string classes. And get is either from iostream=
=2E
>=20
> You can make your own getline, overload it
> void getline(char *buffer, int size){
> char test =3D 'a';
> for (int i =3D 0; i < size && test !=3D '\n'; i++){
> buffer[i] =3D get();
> test =3D buffer[i];
> }
> }
>=20
> The Tone'ster escribi=F3:
>=20
> > To recap :
> >
> > I was trying to use the "getline()" function in the GCC/GNU distro as i=
ncluded
> > in Dev-Cpp v5 beta.
> >
> > I was getting an error from the linker.
> >
> > I looked into the <iostream.h>.
> >
> > This appears to be a C++ header.
> >
> > I am developing/compiling as 'C'.
> >
> > I tried it anyway.
> >
> > compile errors. to be expected.
> >
> > The GCC docs seem to imply that this is a <stdio.h> function that can b=
e used
> > from 'C' code ?
> >
> > ???
> >
> > TIA,
> > Tony
> >
> > --- Carlos Garc=EDa del Monte <cg...@wo...> wrote:
> > > #include <iostream.h>
> >
> > =3D=3D=3D=3D=3D
> >
> > -------------------------------------------------------
> > This SF.NET email is sponsored by: AMD - Your access to the experts
> > on Hammer Technology! Open Source & Linux Developers, register now
> > for the AMD Developer Symposium. Code: EX8664
> > http://www.developwithamd.com/developerlab
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.NET email is sponsored by: AMD - Your access to the experts
> on Hammer Technology! Open Source & Linux Developers, register now
> for the AMD Developer Symposium. Code: EX8664
> http://www.developwithamd.com/developerlab
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|