Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / December 2006

Tip: Looking for answers? Try searching our database.

i can't define a string - help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack - 10 Dec 2006 19:21 GMT
#include <string>
#include <iostream>

int main(){
    string s= "Application";

    return 0;
}

What am i doing wrong, I get an error message saying 'string undeclared
identifier'. This used to work.
William DePalo [MVP VC++] - 10 Dec 2006 19:38 GMT
> #include <string>
> #include <iostream>
[quoted text clipped - 7 lines]
> What am i doing wrong, I get an error message saying 'string undeclared
> identifier'. This used to work.

Try

std::string s = "Application";

then look up name spaces in your favorite C++ reference.

Regards,
Will
Peter Ritchie [C# MVP] - 10 Dec 2006 19:47 GMT
Standard C++ library 101...  Try std::string instead, or add a using
namespace directive after your includes: "using namespace std;"
Signature

Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#

> #include <string>
> #include <iostream>
[quoted text clipped - 7 lines]
> What am i doing wrong, I get an error message saying 'string undeclared
> identifier'. This used to work.
David Anton - 11 Dec 2006 00:00 GMT
C++/CLI:
String ^s = "Application";
or:
System::String ^s = "Application";
Signature

David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: VB to Python converter

> #include <string>
> #include <iostream>
[quoted text clipped - 7 lines]
> What am i doing wrong, I get an error message saying 'string undeclared
> identifier'. This used to work.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.