Results 1 to 6 of 6

Thread: totaly new to c++ (not to vb though)

  1. #1

    Thread Starter
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335

    totaly new to c++ (not to vb though)

    OK im new to C++ and i dont know nothing yet. I wanted to know first how do i make a srting? In vb i go

    dim StrString as string

    in c++ do i do it like

    char MyString = "String Data"
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    how about getting started with a tutorial?
    http://newdata.box.sk/bx/c/
    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.

  3. #3

    Thread Starter
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335
    ive been there and that doesnt really help thanks anyway i got the string thing to work almost.

    whats wronge with this?

    Code:
    char *myString = "Jason Lopez";
    
    SetWindowText(label,*myString);
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

  4. #4

    Thread Starter
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335
    got it
    Code:
    char *myString = "Jason Lopez";
    
    SetWindowText(label,*myString);
    
    needs to be 
    
    char *myString = "Jason Lopez";
    
    SetWindowText(label,myString);
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You'd be better off with console programming...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169

    Re: totaly new to c++ (not to vb though)

    Originally posted by JasonLpz
    OK im new to C++ and i dont know nothing yet. I wanted to know first how do i make a srting? In vb i go

    dim StrString as string

    in c++ do i do it like

    char MyString = "String Data"
    In C++, strings are a class:
    Code:
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    int main() {
        string s = "Hello";
        string x = "World!";
    
        cout << s << ' ' << x << 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

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