wtf am I doing wrong? could use a bit of help with Dev-C++

KarsinTheHutt

Golden Member
Jun 28, 2000
1,687
0
0
Dev-C++ does not seem to acknowledge the string variable type!

#include <stdlib.h> has absolutely no effect! wtf?

Stroustrep's book says that the string variable type is part of the C++ language, so either his book is wrong or the GNU compiler is fscking wrong!

Hmmm... has anyone here used bloodshed's Dev-C++ and the GNU compiler before? Any ideas on why I can't declare string variable types?

I guess I could use char* but I still want to know why strings don't work...
 

Deeko

Lifer
Jun 16, 2000
30,213
12
81
AFAIK there is no string support in ANSI C++. MFC has a string class, cstring, but i don't think standard C++ has support for it. Just use char, that what I do.
 

StageLeft

No Lifer
Sep 29, 2000
70,150
5
0
I remember using strings in C++ is fuN! I mean not fun at all, then I remember my first or second class in VB and they went over strings and I was like &quot;OMG, this is child's play&quot;. Oh well, no pain no gain. Char it is then - an aray of char. ick, glad its not me :)
 

Deeko

Lifer
Jun 16, 2000
30,213
12
81
If you really don't want to use char, the CollegeBoard put out a string class for use with their AP Test. www.collegeboard.com I have AP C++ now in school, so we are using it....it's alot like using a string in Basic.
 

Pretender

Banned
Mar 14, 2000
7,192
0
0
stdlib.h is a standard ANSI C library. The string class is only available in C++, and probably in a different header.
 

KarsinTheHutt

Golden Member
Jun 28, 2000
1,687
0
0
dam. Ok... I'm trying to port a program i wrote under unix to dos.

Wrote and compiled under a sun cc compiler 6.0. used <cstdlib> instead of <stdlb.h> which is why I think its not recoginized the string variable type.

Hmmm... thats quite annoying. I've looked through about 50 header files and no luck...