Results 1 to 7 of 7

Thread: Strings

  1. #1

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Unhappy Strings

    Anyone knows a good tutorials for strings? Also, a tutorials to make owner-draw menus? Thanks in advance
    Amon Ra
    The Power of Learning.

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Here is an example on owner drawn control and menus (it is MFC and the comments are not in English).
    Attached Files Attached Files
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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 refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Red face ohhh...

    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?
    Amon Ra
    The Power of Learning.

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    string::substr(start, length)

    Basically it's Mid$
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Unhappy Parksie....

    What is the :
    Code:
    using namespace std;
    for??
    Amon Ra
    The Power of Learning.

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width