Results 1 to 26 of 26

Thread: Im a newb, plz help

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    I thought you knew!!
    Posts
    38

    Talking Im a newb, plz help

    Hi, I just started C++, and so far I like it... Well, Can you tell me how to open a connection to another PC? Just curious....

  2. #2
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    thats not really a newbie question...just how much do you know?

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    I thought you knew!!
    Posts
    38

    .

    I know how to add 2 numbers.. lol

  4. #4
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    i don't think you are ready to connect to another computer then.

    Try looking in the FAQ to learn a little more about general c++.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  5. #5
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    A connection to another PC?? Hmm, Ive been learning C++ for a while now.. (my 3rd year?? i thinkso) and yet i dont know how to even make a connection to another computer.

    But i have an idea for u... if you know C++ good enough to understand whats going on in a program.. then you can create a new win32 project and lookup winsock or winsck32 somewhere in msdn and that should show you what you need to know... but i tell you, that will be much more than just adding to 4.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  6. #6

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    I thought you knew!!
    Posts
    38

    Red face Another question...

    I have another question, is it possible to make a msgbox pop up? And how can I delete a file?

  7. #7
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Another question...

    Originally posted by PunK
    I have another question, is it possible to make a msgbox pop up? And how can I delete a file?
    If you are talking about a Win32 app, then yes. Use the MessageBox API to bring up a messagebox.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  8. #8
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  9. #9

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    I thought you knew!!
    Posts
    38

    Talking Gah

    lol, I have another question. How can I tell if a string is "good"?

    I have this code:

    #include <iostream.h>

    void main() {
    char nam[100] ;
    char ans[100] ;

    cout << "Hi, whats your name?" ;
    cin >> nam ;
    cout << "How are you doing " << nam << "?" ;
    cin >> ans
    if ans = "good" then ;
    cout << "Thats good!" ;
    endl;
    }

    But it underlines the "if" and says " ';' expected "

  10. #10

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    I thought you knew!!
    Posts
    38

    Post asdf

    Nvrmnd I figured it out, considering theres like 5 things missing, lol

  11. #11
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625

    Re: Gah

    Originally posted by PunK
    lol, I have another question. How can I tell if a string is "good"?

    I have this code:

    #include <iostream.h>

    void main() {
    char nam[100] ;
    char ans[100] ;

    cout << "Hi, whats your name?" ;
    cin >> nam ;
    cout << "How are you doing " << nam << "?" ;
    cin >> ans
    if ans = "good" then ;
    cout << "Thats good!" ;
    endl;
    }

    But it underlines the "if" and says " ';' expected "
    Code:
    	cin >> nam ;
    	// should be:
    	cin.getline(name,81);
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  12. #12

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    I thought you knew!!
    Posts
    38

    Talking .

    We might as well make this a chatroom, lol. How do I do an if then else statement?

    Like:

    if (ans) "good" ;
    cout << "Thats cool" ;
    else ;
    if (ans) "bad" ;
    cout << "" ;
    endl ;




    AND how can I make options? (ie: 1. Exit 2. Blah)
    AND how can I tell if a file exists?
    Last edited by PunK; Sep 24th, 2001 at 04:34 PM.

  13. #13
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    What is this if stuff. What language is it in?
    Nevermind. This is the structure of if-else in C++.
    if ( expression ) statement
    if ( expression ) statement else statement
    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

  14. #14
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    If you are interested in connecting PC's learn WinSock. Just bear in mind that it is not easy and requires C++ expirience. Here is a

    great site
    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

  15. #15
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    if you do not know how to use if else statements (although they are identically the same in many languages), then it will be a bigger burden on your side to learn about winSock... but nevertheless, we do have a C/C++ Tutorial here in vbforums.com... take a look at the C/C++ Faq.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  16. #16

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    I thought you knew!!
    Posts
    38

    Post .................

    ..........How do I make options?
    (Example)
    1. Blah
    2. Blahblah
    3. Exit
    Enter a number:



    ..........How do I check if a file exists?

  17. #17
    I suggest buying a book, all those little basic thingies are in them ^_^

  18. #18
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Yes, by all means buy a book. Have a look at the FAQ for links to free online books.
    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

  19. #19

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    I thought you knew!!
    Posts
    38

    Exclamation

    I planned on buying a book. I am learning how the codes work.

  20. #20

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    I thought you knew!!
    Posts
    38

    Angry Ok, no

    I cant get 'remove' or 'unlink' to work! Someone posted a thingy that said to delete a file use 'remove("yada.yada")' It doesnt work, I've been trying to get it to work forever! Can you help?

  21. #21
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    try something like this:

    PHP Code:
    remove("C:\\msdos.sys"); 
    The way you asked all the questions in the same thread made me laugh a little.

    BTW you are really a "punk".
    Last edited by abdul; Sep 25th, 2001 at 11:31 PM.
    Baaaaaaaaah

  22. #22
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    Originally posted by abdul
    try something like this:

    PHP Code:
    remove("C:\\msdos.sys"); 
    The way you asked all the questions in the same thread made me lough a little.

    BTW you are really a "punk".
    Ahahahaha!!! LOL @ Abdul.

    Try it! it just might work
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  23. #23
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    heheh

    BTW use two slashes, "\\" instead of "\".
    So the code looks like this:

    PHP Code:
    remove("C:\\msdos.sys"); 
    Baaaaaaaaah

  24. #24
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Rule #666 of posting code, you can't use \\ in [php] tags

    Also, the "\" should only make a difference when there's an escapable character after it. Don't know if you HAVE to escape them all the time though. Either way, it's safest to use:
    Code:
    remove("C:\\msdos.sys");
    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

  25. #25
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Yah, I was wondering why I could not show "\\".
    Baaaaaaaaah

  26. #26
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    you can show it inside the php tag by using 4 of them

    like:
    PHP Code:
    remove("C:\\\\msdos.sys"); 
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

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