Search:

Type: Posts; User: socket

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    15
    Views
    1,951

    How does this effect the system? Once the...

    How does this effect the system?
    Once the program is killed is there still a memory leak?
    How do you fix the memory leak once this happened?
  2. Replies
    15
    Views
    1,951

    Thank you very much. Please tell me what...

    Thank you very much.

    Please tell me what happens if you do not free(name); ?
  3. Replies
    15
    Views
    1,951

    I'm simply wanting to take in any argument...

    I'm simply wanting to take in any argument (string) and allocate enough size to a variable so I can store the input ot a variable.
    I don't want to have a set size. (ie: char buf[10];)
    Input may be...
  4. Replies
    15
    Views
    1,951

    For example. I know I can do the following. ...

    For example.

    I know I can do the following.

    char *name = "myname";
    char buf[10];

    strcpy(buf,name);

    But is my above post doing the same thing?
  5. Replies
    15
    Views
    1,951

    I am wanting to put argv[1] in my variable name.

    I am wanting to put argv[1] in my variable name.
  6. Replies
    15
    Views
    1,951

    Is this correct : passing strings?

    #include <stdio.h>

    int main(int argc, char **argv)
    {
    char *name = NULL;

    name = argv[1];

    printf("Name is %s\n", name);
  7. Replies
    1
    Views
    1,055

    Where to go from here?

    Okay..
    I can read / write / understand any book on C.
    When I say any book I mean any "Learn C" sort of book.

    My problem now is.. How do I learn more.
    The most advanced project I have made was...
  8. Thread: Sring help

    by socket
    Replies
    11
    Views
    940

    I have error checking on strstr and it's not...

    I have error checking on strstr and it's not there.
    I print out buf before parsing the string and yes PING starts.
    PING :blah.blah.blah
  9. Thread: Sring help

    by socket
    Replies
    11
    Views
    940

    That doesn't work either. I'm really at a lost...

    That doesn't work either.
    I'm really at a lost right now.
  10. Thread: Sring help

    by socket
    Replies
    11
    Views
    940

    They did. sread = recv(s, buf,...

    They did.



    sread = recv(s, buf, sizeof(buf),0); //contents stored in buf
  11. Thread: Sring help

    by socket
    Replies
    11
    Views
    940

    char *p; p = buf; while((*p++ = getchar()) !=...

    char *p;
    p = buf;
    while((*p++ = getchar()) != '\n');
    *p='\0';

    that should work but still doesn't give me anything back from sscanf
  12. Thread: Sring help

    by socket
    Replies
    11
    Views
    940

    Thats the problem I think I'm running into....

    Thats the problem I think I'm running into.
    It's not null terminated.
    How can I add it to the end of the string.
    I've tride for looping to the end and then add buf[j] = '\0'; but that doesn't...
  13. Thread: Sring help

    by socket
    Replies
    11
    Views
    940

    Sring help

    if(strstr(buf,"PING"))
    {
    sscanf(buf,"PING :%s",str);
    printf("BOT WILL SEND BACK %s\n",str);
    }


    the contents of buf is received through a socket....
  14. How can I tell when receiving buffer is no longer receiving?

    Basically I'm connecting to a server.
    I have the client reading in what the server says.
    How can I tell when the server is done sending data?

    Here is what I have


    ...
  15. Replies
    3
    Views
    858

    what string function??

    Example:
    I have a string with this "<a href="www.somesite.com">Somesite</a>"

    with strstr(str,str1);
    I can find where href starts.
    Now what C string function can I use to go from the href...
  16. Thread: Array help

    by socket
    Replies
    3
    Views
    644

    Array help

    Why doesn't this work?



    #include <stdio.h>
    #include <stdlib.h>

    int main()
    {
    char *string="This is a long string!";
  17. Replies
    7
    Views
    1,241

    Works great thank you. Just out of curiosity is...

    Works great thank you.
    Just out of curiosity is there another way to do this other than using ptrdiff_t?
  18. Replies
    7
    Views
    1,241

    strstr string help

    I have a string with the word scuba in it.
    I know how to find it. Well I know how to get a char *c to 's'.
    But what I would like to do is search the string for scuba, after finding s with strstr I...
  19. Replies
    7
    Views
    1,125

    Need some memory help

    I think I'm a little confused.
    Could someone please shed some light on memory allocation.

    Basically I would like to create a variable that can hold any amount of bytes.
    I do not know how many...
  20. Replies
    13
    Views
    1,261

    Let's forget the buffer. Can I just create a...

    Let's forget the buffer.
    Can I just create a 'buffer' that can expand or allocate as needed.
    I do not know how large each site will be.
    Can't I just create a variable to hold all sizes?
  21. Replies
    13
    Views
    1,261

    Assuming you read the source code you will see...

    Assuming you read the source code you will see where I do send a message to the server.

    I do receive the first 300 bytes or so of the index file. That is all.
    Hence why I said is it a buffer...
  22. Replies
    13
    Views
    1,261

    That does not fix it.

    That does not fix it.
  23. Replies
    13
    Views
    1,261

    Did not work :( Anyone else?

    Did not work :(
    Anyone else?
  24. Replies
    13
    Views
    1,261

    still doesn't work. Just blank space ...

    still doesn't work.
    Just blank space



    #include <stdio.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <netdb.h>
  25. Replies
    13
    Views
    1,261

    Never mind found it. I keep getting error...

    Never mind found it.


    I keep getting error
    client.c:60: error: syntax error at end of input



    unsigned char c;
    while(read(sockfd,&c,1) >= 0) putchar(c);
Results 1 to 25 of 26
Page 1 of 2 1 2