|
-
Aug 28th, 2001, 07:29 AM
#1
Thread Starter
Addicted Member
What type?
what type do i declare something if i want it to be able to hold multiple characters? i've tried string but it doesn't exist, do i need to add a special library?
-
Aug 28th, 2001, 08:00 AM
#2
transcendental analytic
you need to include string if you want to use it:
#include <string>
you can also use character arrays
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 28th, 2001, 08:00 AM
#3
Frenzied Member
To use string as a datatype (as in VB):
Code:
#include <string>
using namespace std;
void main()
{
string mystr = "something";
mystr = mystr + "something else"
}
-
Aug 28th, 2001, 08:02 AM
#4
Frenzied Member
Of course you can use char arrays.
Code:
char mystr[] = "something"
//will have to use functions like strcpy etc.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|