From: Dave Pearson Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem with the string data format! Date: Mon, 19 May 1997 16:42:06 GMT Organization: Hagbard's World (A Private Internet Host) Sender: usenet AT hagbard DOT demon DOT co DOT uk Message-ID: References: <01bc643c$9a240b00$d541b7c2 AT engineering5 DOT engineering DOT it> <5lppiq$dv9 AT news DOT ox DOT ac DOT uk> Lines: 57 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On 19 May 1997 14:54:18 GMT, George Foot wrote: > Lorenzo Soncini (lsoncini AT mbox DOT linknet DOT it) wrote: > : How can I use the string data type with DJGpp ? > > C doesn't have a string data type; a string is viewed as an array of > chars. For example: > > char my_string[80]; > > Then my_string could hold up to 79 characters, plus one '\0' to mark > the end of the string. Looking at what the poster was asking and the code he included I don't think he is asking about C but about C++. His mistake, as far as I can see, is that he is including when he should really be including (note no .h). In the case of his example, he probably wants something more along the lines of: -- foo.cpp ----------------------------------------------------------- #include #include int main( void ) { string s; s = "Hello, World!"; cout << s << endl; s += "\nLook ma! No strcat()!"; cout << s << endl; return( 0 ); } ---------------------------------------------------------------------- and then he needs to compile with: gxx foo.cpp -o foo > You should get a book on C programming to learn about this; it is a > big topic and shouldn't really be on this mailing list/newsgroup. Considering the fact that he appears to be asking about C++ that's a little unfair. :-) -- Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader. http://www.acemake.com/hagbard/ | ng2html - The NG to HTML converter. Also available in the UK: | eg - Norton Guide reader for Linux. http://www.hagbard.demon.co.uk/ | dgscan - DGROUP scanner for Clipper.