Error String Is Not A Member Of Std
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring
String Is Not A Member Of Std C++
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question to string is not a member of std g++ x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them;
Error To_string Is Not A Member Of Std
it only takes a minute: Sign up I have included string.h but when i try to use it as in the following i get errors up vote 4 down vote favorite I have included string.h but when i try error cout is not a member of std to use it as in the following i get errors #include std::string something; here std will be flagged and it says ** error C2039: 'string' : is not a member of 'std'** But in other parts of my program it works, only in some places i do get this error c++ string std member share|improve this question edited Mar 4 '12 at 14:16 Agnius Vasiliauskas 5,25022849 asked Mar 4 '12 at 14:13 John 3722928 add a comment| 2 Answers tostring is not a member of std 2 active oldest votes up vote 11 down vote accepted The correct header file for std::string is string, not string.h. share|improve this answer answered Mar 4 '12 at 14:15 user420442 that solved it. Thanks! But .... then, why does it work in other parts of my program with the .h? –John Mar 4 '12 at 14:15 2 I would assume the correct header is being pulled in from another header file that's also included and your inclusion of string.h is redundant. –user420442 Mar 4 '12 at 14:18 2 string.h is the string header from the c-library (whose c++ equivalent would be the cstring header) –ComicSansMS Mar 4 '12 at 14:30 add a comment| up vote 1 down vote std::string dos not exist in C. Probably you want to use C++. share|improve this answer answered Mar 4 '12 at 14:16 Matthew Flaschen 175k28368450 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged c++ string std member or ask your own question. asked 4 years ago viewed 4767 times active 4 years ago Related 41Why am I
"stdafx.h" #include "ZerpAlarm.h" #include class ZerpAlarm final { private: std::string stratimes[2]; std::string straMessages[2]; public: ZerpAlarm(); ZerpAlarm(const std::string* t,
Error C2039 Is Not A Member Of
const std::string* m); }; Do any of you see what's wrong? Last error c2039: is not a member of 'std' edited on Aug 31, 2013 at 1:04pm UTC Aug 31, 2013 at 1:07pm UTC R10111001 (37) You included
Error C2039 'cout' Is Not A Member Of 'std'
instead of . Aug 31, 2013 at 1:11pm UTC Zerpent (134) But I wanted to start using cstring instead since I guess that's better for C++. Or am I wrong? How http://stackoverflow.com/questions/9555559/i-have-included-string-h-but-when-i-try-to-use-it-as-in-the-following-i-get-erro do you use cstrings then? I even changed to "#include " now and I still get the same error. Last edited on Aug 31, 2013 at 1:13pm UTC Aug 31, 2013 at 1:25pm UTC vlad from moscow (6539) @Zerpent But I wanted to start using cstring instead since I guess that's better for C++. What is cstring?! As for the header file http://www.cplusplus.com/forum/beginner/109648/ named cstring in C++ programs then it contains declarations of standard C functions as for example strlen. It seems that you get the error again because it is possible that inside header file "ZerpAlarm.h" there are also some references to std::string. If so then you should include also in this file. Aug 31, 2013 at 1:27pm UTC Stewbond (2810) There are three headers which is probably the cause of your confusion: 1
2
3
#include // This contains utilities for modifying c-style string #include // This is the C++ version of the library above. It effectively just puts everything in std:: #include // this contains the std::string class. Last edited on Aug 31, 2013 at 9:44pm UTC Aug 31, 2013 at 1:28pm UTC Zerpent (134) Well, I started a new project and I use again. Now it works. Sorry for my confusion and thanks for the help. Topic archived. No new replies allowed. C++ Information Tutorials Reference Articles Forum Forum BeginnersWindows ProgrammingUNIX/Linux ProgrammingGeneral C++ ProgrammingLoungeJobs Home page | Privacy policy© cplusplus.com, 2000-2016 - All rights reserved - v3.1Spotted an error? contact us
Forum Visual C++ & C++ Programming C++ (Non Visual C++ Issues) error C2039: 'string' : is not a member of 'std' If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before http://forums.codeguru.com/showthread.php?423566-error-C2039-string-is-not-a-member-of-std you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 8 of 8 Thread: error C2039: 'string' : is not a member of 'std' Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode May 15th, 2007,05:57 AM #1 riruilo View Profile View Forum Posts Member Join Date May 2007 Location Valencia, Spain is not ( Europe ) Posts 73 error C2039: 'string' : is not a member of 'std' [SOLVED, thanks] Hi friends! My project worked nice but after I have installed the new FCOLLADA (a library) and and get this error: error C2039: 'string' : is not a member of 'std' Any idea? Last edited by riruilo; May 15th, 2007 at 08:49 AM. Reply With Quote May 15th, 2007,06:11 AM #2 Zaccheus View Profile View Forum Posts Visit Homepage Elite Member Join Date Apr 2004 Location England, Europe Posts 2,492 is not a Re: error C2039: 'string' : is not a member of 'std' Without any more details, all I can suggest is: Code: #include My hobby projects: www.rclsoftware.org.uk Reply With Quote May 15th, 2007,06:13 AM #3 AlbertGM View Profile View Forum Posts Member Join Date Nov 2006 Location Barcelona - Catalonia Posts 364 Re: error C2039: 'string' : is not a member of 'std' And maybe Code: using std::string; Albert. Please, correct me. I'm just learning.... and sorry for my english :-) Reply With Quote May 15th, 2007,06:13 AM #4 riruilo View Profile View Forum Posts Member Join Date May 2007 Location Valencia, Spain ( Europe ) Posts 73 Re: error C2039: 'string' : is not a member of 'std' Thanks. with #include my project works. But WHY before it was working without that? Thank you very much. Reply With Quote May 15th, 2007,06:58 AM #5 AlbertGM View Profile View Forum Posts Member Join Date Nov 2006 Location Barcelona - Catalonia Posts 364 Re: error C2039: 'string' : is not a member of 'std' Please, post the code where it gives the error. Albert. Please, correct me. I'm just learning.... and sorry for my english :-) Reply With Quote May 15th, 2007,07:14 AM #6 riruilo View Profile View Forum Posts Member Join Date May 2007 Location Valencia, Spain ( Europe ) Posts 73 Re: error C2039: 'string' : is not a member of 'std' Hi. Well, actually I changed nothing of my code, just a new version of a LIB file. My program is very large, a