All pastes #525877 Raw Edit

Someone

public text v1 · immutable
#525877 ·published 2007-05-31 15:48 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <netdb.h>
#include <errno.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>

#define PORT 80
#define MAXDATASIZE 100

getdomain(char *mylink){
        char mydomain[100];
        printf("LINK: %s\n", mylink);
        strcpy(mydomain, mylink);
        strcat(mydomain, ".com");
        printf("URL: %s\n", mydomain);
        return *mydomain;
}

int main(int argc, char *argv[]){
        char mydomain[100], mylink[100];

        if(argc < 2){
        printf("usage: ./rss-get feed-url\n");
        exit(1);
        }

        *mydomain = getdomain(argv[1]);
        printf("URL: %s\n", mydomain); // if mydomain holds the address
                                       // of the variable. how do i refer
                                       // to the whole variable/array?

} // MAIN