Anyone knows a good tutorials for strings? Also, a tutorials to make owner-draw menus? Thanks in advance :)
Printable View
Anyone knows a good tutorials for strings? Also, a tutorials to make owner-draw menus? Thanks in advance :)
Here is an example on owner drawn control and menus (it is MFC and the comments are not in English).
So that's basically useless to a real programmer ;) j/k
For strings, you don't really need a tutorial:
Code:#include <iostream>
#include <string>
using namespace std;
void main() {
string x = "Hello";
string y = x + " ggg " + x.substr(2,2);
cout << y << endl;
}
I guess <string> is different from <string.h>, cuz when i tried string.h, there were a lot of weird stuff... :) btw, what is the last part of the string y=... line for? with the 2.2?
string::substr(start, length)
Basically it's Mid$ :)
What is the :
for??Code:using namespace std;
To prevent name collisions, everything in the STL is in a namespace called "std". So, if you already have a list class, it won't kill it.