Search:

Type: Posts; User: tindala

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    331

    but anyway, by curiosity, why res had changed to...

    but anyway, by curiosity, why res had changed to not accessible? i did not change it anywhere
  2. Replies
    4
    Views
    331

    hints.ai_flags=AI_CANONNAME | AI_NUMERICSERV; ...

    hints.ai_flags=AI_CANONNAME | AI_NUMERICSERV;

    addrlen=sizeof(*res);
    recvfrom(fd,buffer,BUFLEN,0,(struct sockaddr*)res, &addrlen);

    +++++++++
    thank u very much for the help, i was hanging...
  3. Replies
    4
    Views
    331

    socket problema

    #define _POSIX_C_SOURCE 1
    #define _XOPEN_SOURCE
    #include <stdio.h>
    #include <string.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netdb.h>
    #include <netinet/in.h>
    #include...
  4. Replies
    3
    Views
    8,454

    for example the following piece of code works, ...

    for example the following piece of code works,




    int main(void)
    {
    struct addrinfo *result;
    struct addrinfo *res;
    int error;
  5. Replies
    3
    Views
    8,454

    thank u for the answering, but why it was not...

    thank u for the answering, but why it was not able to resolve the name? is there a way to find out?
  6. Replies
    3
    Views
    8,454

    getnameinfo() example problem

    Hi,
    i have seen this thread:
    http://cboard.cprogramming.com/linux-programming/94179-getnameinfo.html

    and i have also tried it

    so, my code is the following:


    int main(int argc, char *...
  7. first of all i want to be able to send the...

    first of all i want to be able to send the message from client to the server. i have more questions about my code, but 1st of all i want to solve that problem.
    my code is very similar to this one:...
  8. client-server prog not working and further questions

    client.c
    reset; gcc -g -Wall -ansi -pedantic client.c -o tt


    #include <stdio.h>
    #include <string.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netdb.h>
    #include...
  9. @Click_here...

    @Click_here, thank you for the answer, i liked ur example to show me how that thing is properly used in some situations.
  10. Replies
    4
    Views
    808

    @anduril462...

    @anduril462, thank u for the clever answer.
    and if i change to :
    sscanf(str, "%*s %c;%c;%c", arg2, arg3, arg4);
    it is still now working :(
    and the way have made to make my objective is the only...
  11. Replies
    4
    Views
    808

    sscanf not working with %s

    Hi,


    #define MAX_READ 100

    int main(int argc, char **argv)
    {
    char *str="DNS guu.ssl;124.138.1.25;60000";
    char arg1[MAX_READ];
    char arg2[MAX_READ];
  12. Replies
    2
    Views
    608

    passing a string to a function from main

    hi,
    i would like to know if i need to dinamically allocate a string in main before passing it to a function that i have created.
    in that function i just read the string and do not change any chat...
  13. @grumpy...

    @grumpy thank you very much for the answer, u got me a very good answer. that clarified me a lot.


    char *command_string;
    command_string = malloc(BUFLEN * sizeof(*command_string));

    isnt the...
  14. @africanwizz...

    @africanwizz , thank you for the usefull link, but i just explained part of my problem, btw can u give me some examples for what is explained in that page, nammely:
    ""
    There is nothing wrong with...
  15. why i do not have to cast the malloc? i have seen...

    why i do not have to cast the malloc? i have seen many examples on the internet that are casting.
    furthermore, if i would like to keep char command_string[BUFLEN];
    then how do i allocate memory...
  16. error: incompatible types when assigning to type char[ ] from type ‘char *’ , malloc(

    #define BUFLEN 512

    int main(int argc, char **argv)
    {
    char command_string[BUFLEN];

    command_string=(char*)malloc(BUFLEN * sizeof(char));
    if(command_string==NULL)
    {...
  17. @anduril462...

    @anduril462 thank you very much for the answer.
    that solved my problem.
  18. Hi, thaank you for the answer, i got the...

    Hi,
    thaank you for the answer, i got the following message when using perror: The following error occurred: Cannot assign requested address
    i used the following iunstruction perror ("The...
  19. [networking] socket problem in bind() and recvfrom()

    hi,
    i have this piece of code:



    /* compilation options: reset; gcc -g -Wall -ansi -pedantic testes.c -o tt */
    #define _POSIX_C_SOURCE 200112L
    #define _XOPEN_SOURCE 600...
  20. Replies
    2
    Views
    725

    cheking the validity of data from stdin

    #include <stdio.h>
    #include <stdlib.h>
    #define MAX_READ 2

    int main( )
    {
    char * secret = "abecedarium consisting This is a string literal!";
    char command[MAX_READ], string[MAX_READ];
    ...
  21. Replies
    6
    Views
    1,078

    i am compiling with the following options: gcc ...

    i am compiling with the following options: gcc -g -Wall -ansi -pedantic testes.c -o tt
  22. Replies
    6
    Views
    1,078

    assign the pointer of a string to an integer

    hi,
    i have this code:



    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
  23. Replies
    5
    Views
    1,205

    i am trying to better understand the function...

    i am trying to better understand the function getservbyname() with some examples
  24. Replies
    5
    Views
    1,205

    here : services(5) - Linux manual page...

    here : services(5) - Linux manual page i found this phrase: port number (and protocol) for its service

    and here : getaddrinfo(3) - Linux manual page
    i found the name service which is treated as...
  25. Replies
    5
    Views
    1,205

    ok, what is the diff betwen service and IP?...

    ok, what is the diff betwen service and IP?
    service is the port?
    i have seen this page:
    services(5) - Linux manual page
    but i still do not understand it properly
Results 1 to 25 of 40
Page 1 of 2 1 2