c++ - Using std::string?
- Kixdemp (26/26) Oct 14 2005 Hello everyone! :-D
- Bertel Brander (15/17) Oct 15 2005 string.h is for C-string manipulation functions, such as
- sulfurik15 gmail.com (22/39) Oct 15 2005 Now I get these errors:
- Kixdemp (3/3) Oct 15 2005 Wait a minute... I don't get any of that if I remove the "-mtd" from the...
- Walter Bright (7/9) Oct 15 2005 command
- Kixdemp (3/12) Oct 15 2005 Blah, that stinks! :-(
Hello everyone! :-D OK, here be my code: ----------------- #include <stdlib.h> #include <string.h> int main() { string hello("Hellawz!!1"); } ----------------- And here's my command line: dmc -mtd -IC:\dm\stlport\stlport dost.cpp This is what I get on compile: ----------------- Z:\dost>dmc -mtd -IC:\dm\stlport\stlport dost.cpp string hello("Hellawz!!1"); ^ dost.cpp(6) : Error: undefined identifier 'string' string hello("Hellawz!!1"); ^ dost.cpp(6) : Warning 6: value of expression is not used --- errorlevel 1 Z:\dost> ----------------- I tried using std::string, using namespace std, nothing worked... anyone know how to fix it? Thanks! ;-)
Oct 14 2005
Kixdemp wrote:#include <string.h>string.h is for C-string manipulation functions, such as strcpy, strcmp, etc. To get C++ stl string use string (note without the .h). E.g: #include <string> using std::string; int main() { string hello("Hellawz!!1"); } -- Absolutely not the best homepage on the net: http://home20.inet.tele.dk/midgaard But it's mine - Bertel
Oct 15 2005
Now I get these errors: ------------------------ using _STLP_VENDOR_CSTD::fgetwc; ^ c:\dm\stlport\stlport\cwchar(199) : Error: undefined identifier 'fgetwc' using _STLP_VENDOR_CSTD::fgetws; ^ c:\dm\stlport\stlport\cwchar(200) : Error: undefined identifier 'fgetws' using _STLP_VENDOR_CSTD::fputwc; ^ c:\dm\stlport\stlport\cwchar(201) : Error: undefined identifier 'fputwc' using _STLP_VENDOR_CSTD::fputws; ^ c:\dm\stlport\stlport\cwchar(202) : Error: undefined identifier 'fputws' using _STLP_VENDOR_CSTD::fwprintf; ^ c:\dm\stlport\stlport\cwchar(210) : Error: undefined identifier 'fwprintf' Fatal error: too many errors --- errorlevel 1 ------------------------ Do you know how I can fix them? Thanks very much! ;-) In article <diqg87$1q4n$1 digitaldaemon.com>, Bertel Brander says...Kixdemp wrote:#include <string.h>string.h is for C-string manipulation functions, such as strcpy, strcmp, etc. To get C++ stl string use string (note without the .h). E.g: #include <string> using std::string; int main() { string hello("Hellawz!!1"); } -- Absolutely not the best homepage on the net: http://home20.inet.tele.dk/midgaard But it's mine - Bertel
Oct 15 2005
Wait a minute... I don't get any of that if I remove the "-mtd" from the command line... I need this program to work on pure MS-DOS... do you know how to fix it? Thanks! ;-)
Oct 15 2005
"Kixdemp" <Kixdemp_member pathlink.com> wrote in message news:dirc31$2g9a$1 digitaldaemon.com...Wait a minute... I don't get any of that if I remove the "-mtd" from thecommandline... I need this program to work on pure MS-DOS... do you know how tofix it? The STL doesn't work under MS-DOS. For one thing, it's a little too large to work with the 'tiny' (-mt) memory model, where code+data needs to fit in 64K. You'll need to stick with the functionality in the C headers.
Oct 15 2005
In article <dirh1n$2k4d$1 digitaldaemon.com>, Walter Bright says..."Kixdemp" <Kixdemp_member pathlink.com> wrote in message news:dirc31$2g9a$1 digitaldaemon.com...Blah, that stinks! :-( Thanks though! ;-)Wait a minute... I don't get any of that if I remove the "-mtd" from thecommandline... I need this program to work on pure MS-DOS... do you know how tofix it? The STL doesn't work under MS-DOS. For one thing, it's a little too large to work with the 'tiny' (-mt) memory model, where code+data needs to fit in 64K. You'll need to stick with the functionality in the C headers.
Oct 15 2005