943,624 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 780
  • C++ RSS
May 15th, 2009
0

how to use a string variable

Expand Post »
i need to know how to make a string variable in C++

i need to hold the file path of the desktop on a variable.

in vb.net it would be like this: dim path as string = "path\to\desktop"
Similar Threads
Reputation Points: 11
Solved Threads: 4
Junior Poster
sacarias40 is offline Offline
113 posts
since Nov 2008
May 15th, 2009
2

Re: how to use a string variable

C++ Syntax (Toggle Plain Text)
  1. std::string path = "path\\to\\desktop";
Don't forget to include the <string> header.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Mixed up with GTK!
Next Thread in C++ Forum Timeline: Question about find()





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC