Thread: Noob-like simple Questions

  1. #1
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361

    Noob-like simple Questions

    This is my first thread on this board, so bear with me. I was scanning through some code, and noticed the send() function.

    It looks like it only sends text. What if you wanted to send something else? That's all for now.
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    You send() bytes. These bytes might form a sentence, a number (character or binary level encoding), or maybe a data type like a struct. It's up to you, just give send a valid pointer, tell it the length of data to send, and off you go.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361
    Okay, Do I need to know winsock for DirectPlay?

    I'm guessing for send() you would cast the data, because the prototype says char*, unless I'm mistaken
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  4. #4
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    I'm guessing for send() you would cast the data, because the prototype says char*, unless I'm mistaken
    You're not mistaken. You send() sizeof(theData) bytes, starting from (char*)&theData
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Two simple questions.
    By Queatrix in forum Windows Programming
    Replies: 10
    Last Post: 10-09-2005, 05:10 PM
  2. Few simple questions...
    By Shane in forum C++ Programming
    Replies: 9
    Last Post: 08-06-2005, 02:40 AM
  3. simple noob question
    By NiVaG in forum Linux Programming
    Replies: 5
    Last Post: 09-28-2004, 06:56 PM
  4. simple noob question: HWND, HDC etc.
    By freedik in forum Windows Programming
    Replies: 12
    Last Post: 08-19-2003, 03:59 AM
  5. A few simple batch questions
    By sean in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 07-02-2003, 01:35 PM