View Single Post
  #3 (permalink)  
Old 07-09-2007, 02:54 PM
rpgfan3233 rpgfan3233 is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jul 2007
Posts: 118
iTrader: (0)
rpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura about
C has no native string data type, object, etc. In C, strings are null-terminated arrays of characters, such as:
const char* hexadecimal = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', '\0'}; /* the '\0' may be replaced by just a 0 without quotation marks */
or you can also do
const char* hexadecimal = "0123456789ABCDEF";

Either way, that is how C strings are declared.

For C++ however, there exists within the standard library (the Standard Template Library, or STL) a class called "string" belonging to the std namespace:
Code:
#include <string>
// uncomment one of the next two lines to use "string" in your code as the data type
// using std::string;
// using namespace std;

// or just use "std::string" in your code as the data type

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote