|
-
Feb 3rd, 2001, 02:30 PM
#1
I'm having trouble with VC++, getting it to recognize the string data type. I have tried including the string.h header like this :
#include "string.h"
and like this :
#include <string>
and each time I hit Build, an error comes up saying :
syntax error : identifier 'string'
any ideas on how to solve it??
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 3rd, 2001, 02:45 PM
#2
Addicted Member
Should it not be..
#include <string.h>
???????
-
Feb 3rd, 2001, 02:47 PM
#3
unfortunately, I've tried that as well, with the exact same result. I mean, I have the header file, and the #include statement worked in another compiler I had a while ago...
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 3rd, 2001, 02:59 PM
#4
Frenzied Member
It used to work for me in CodeWarrior...someone said to try #include <string>
-
Feb 3rd, 2001, 03:52 PM
#5
alright, lets say, I can't get it to work, is there a built-in string data type?? I saw BStr, or something somewhere, what's that?
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 3rd, 2001, 04:16 PM
#6
Frenzied Member
Use This:
Code:
#include <string>
using namespace std;
....
string mystring;
mystring = "Something"
//and so on
-
Feb 3rd, 2001, 04:24 PM
#7
WOW!
If you were here I'd be bending you over my desk and dry-humping you right now!
Thanks, Vlatko, I thought that namespace thing looked familiar...
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 3rd, 2001, 06:08 PM
#8
Monday Morning Lunatic
BSTR is more similar to LPTSTR - it's basically an OLECHAR* array. COM in C++ supports the bstr_t wrapper class that acts a bit like basic_string<OLECHAR>.
Useful but pointless information:
string is actually a typedef for basic_string<char>, so you can make a string equivalent of LPTSTR by using typedef basic_string<TCHAR> tstring.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 3rd, 2001, 08:29 PM
#9
Re: WOW!
Originally posted by crptcblade
If you were here I'd be bending you over my desk and dry-humping you right now!
Thanks, Vlatko, I thought that namespace thing looked familiar...
Ok, thats a little sick!!!
sorry I don't have anything useful to contribute.. but thats just sick...
hehehe, and I can't stop laughing
-
Feb 3rd, 2001, 08:59 PM
#10
That's me Dennis...
{Sing along}I'm just a little monkey here to make you laugh...{end of Sing along}
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|