Results 1 to 2 of 2

Thread: Dammned Variables

  1. #1

    Thread Starter
    Hyperactive Member Azz00's Avatar
    Join Date
    Sep 2001
    Location
    Scotland
    Posts
    457

    Dammned Variables

    This is driving me nut's

    why wont this work... and i know for a fact the pkt.u.buf variable contains the string i want

    err = dpGetPlayerName(myDP, idFrom, nameBuf, sizeof(nameBuf));
    pkt.u.buf[size-sizeof(dp_packetType_t)] = 0; /* Null terminate */


    if (pkt.u.buf == "<userlist") {
    printf("CALLED")
    }

    it just dosent activate the stament. and i dont know why
    www.azzmedia.co.uk

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Your code is taken out of context and nearly impossible to read. But I guess pkt.u.buf is a char array.

    You can't compare C-style strings this way. You have to use strcmp.
    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.

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