Hey Hey, do you know why that that's the limit?
Well do you know the limit of an array in QB?
It's 32767 if I'm not mistaken....
Now do you know that a String is just an array of chars?
Makes sense doesn't it....
In C++ the is a var called char, it's like int, or double, or long, or string, etc.
a char is like a string but only 1 value....
It's very easy to convert chars to ints, because when you cast a char to an int you get the ASCII value of that char in the int.
So
char i='9';
cout<<int(i)<<endl;
would output
57
and
int i=57;
cout<<char(i)<<endl;
would output
9
Notice the ' ', you have to do that for a char like you do " " for a string.
Now C++ can't directly cast a string to an int so what so you do? You make each one a char that you want to....
Now in QB this is easy you have the val() and the str$()
But in c++ its not that easy
but to make a certain part of a string in C++ an int is easy cause you don't need to deal with substr (like mid$ in QB):
Since a String is an array of chars:
string A="12334"
cout<<int(A[1])<<endl;
Guess what that would output?
A[1] is a char so
it would output ascii(2) what ever that is
wait a minute you said A[1] = 2?
isn't A[1] = 1? cause its in the first slot?
NO it starts at 0! then the second pos is 1, very confusing expesially for the .length() method and converting...heh
Oh well I guess I went off topic again...heh