Search:

Type: Posts; User: headbr

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    6,065

    gethostbyname() won't work...

    I am trying to connect to a server that I create. My server works fine if the client is in the same host because I use this in the client code:


    serverAddr.sin_addr.s_addr = htonl(INADDR_ANY);
    ...
  2. Replies
    36
    Views
    5,242

    I am pretty sure the % operator doesn't work on...

    I am pretty sure the % operator doesn't work on c89 nor c90...
  3. Replies
    2
    Views
    1,616

    Trouble with recursion...

    I am trying to implement the unix command in my program "ls -R" without the system call.

    Right now, what my recursion code does is like, go to the folder (either ./ or a specified one) and look at...
  4. Replies
    3
    Views
    1,723

    Getting garbage after I malloc space...

    So my goal is to get the name of the directory by itself.
    But when I print it at the end, I get the name + some garbage.
    I don't understand why, since I am malloc'ing the right amount of...
  5. Replies
    9
    Views
    1,661

    I figured it out! Teehee! :D status wasn't...

    I figured it out! Teehee! :D

    status wasn't allocated anywhere, that was the problem.. hihi xD
  6. Replies
    9
    Views
    1,661

    errno is 14

    errno is 14
  7. Replies
    9
    Views
    1,661

    Hee hee xD I wanted a "&&" there. ;D Now the...

    Hee hee xD
    I wanted a "&&" there. ;D

    Now the fileName, which is the path, is correct.. The only thing is that I still get the same error when trying to use stat() =\
  8. Replies
    9
    Views
    1,661

    Hm... I have this in between the strcat and the...

    Hm... I have this in between the strcat and the if (stat...



    if ((strcmp(dirent[i]->d_name, ".") != 0) ||
    (strcmp(dirent[i]->d_name, "..") != 0)){
    puts("1");
    strcat(fileName,...
  9. Replies
    9
    Views
    1,661

    I did a perror instead of printf (I don't know...

    I did a perror instead of printf (I don't know how to get errno..)

    and I got "Bad address"...

    So I printed out fileName, and I get this: .../home/project5/.

    That period is messing me up?...
  10. Replies
    9
    Views
    1,661

    Problems with stat()

    Hi guys, I have a project where we have to implement the ls command and some options.

    One of those options is -l, and so I am trying to get the file information in hand.

    I am using this for the...
  11. Oooo snap! I got it... I actually did what you...

    Oooo snap! I got it...

    I actually did what you told me, paste it to notepad! ;D

    I didn't tried that before, but now it works ;D
    Just have some simple warnings, but those I can take care of.
    ...
  12. I've done that first option before... I...

    I've done that first option before...

    I grabbed the first few lines of hexes (without spaces) and pasted into this hex to ascii converter (http://www.dolcevie.com/js/converter.html)

    By plugging...
  13. Woah.. I got lots of hexes! But now, what do I...

    Woah.. I got lots of hexes!

    But now, what do I do? What do those hexes tell me?
    What did you want me to look for?
  14. How do I use a text editor? And which one to get?...

    How do I use a text editor? And which one to get? =\
  15. Sorry about the [URGENT]... Didn't think of...

    Sorry about the [URGENT]... Didn't think of that.. =\

    I've went thru my code to see if I find those \r chars and *nix and didnt find any

    I have managed to hold my scroll bar to see what the...
  16. [URGENT] Getting warning: null character(s) ignored repeatedly

    When I compile my driver.c in MVS. It runs fine... But when I do on my schools linux machine
    after typing gcc driver.c it gives me a bunch of those messages. IE:


    driver.c:301:169: warning: null...
  17. I guess I am not understanding how to use fgets...

    I guess I am not understanding how to use fgets and realloc, let us do this example:


    char *adjRooms = (char *)malloc(sizeof(char) * 5); //Adjacent rooms
    int roomNum = -1;
    ...
  18. Oh geez.. now I ran into a different problem. We...

    Oh geez.. now I ran into a different problem. We don't know how big the input could be...

    So the professor mentioned the use of fgets, but I don't know how to get the other stuff that fgets dont...
  19. Good windows debugger for C? Microsoft Visual...

    Good windows debugger for C? Microsoft Visual Studio ;D
  20. I see what you are saying... I definitely thought...

    I see what you are saying... I definitely thought of that, but I asked the professor and he wants us to do it in that format.

    I think it's kind of pointless to spend a lot of time in this small...
  21. So I am guessing there isn't a built-in easy...

    So I am guessing there isn't a built-in easy function eh?

    So basically the helper function would be like, get a string, remove the ',' and grab the numbers until you hit ')'?

    Oh boy... Here I...
  22. Reading different amounts of input in between parenthesis?

    Hi guys, I just registered in this forum! Nice to see that there is a big community of coders helping each other out! ;D

    Well, my issue is the following. A player has to input a room number, and...
Results 1 to 22 of 22