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);
...
Type: Posts; User: headbr
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);
...
I am pretty sure the % operator doesn't work on c89 nor c90...
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...
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...
I figured it out! Teehee! :D
status wasn't allocated anywhere, that was the problem.. hihi xD
errno is 14
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() =\
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,...
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?...
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...
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.
...
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...
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?
How do I use a text editor? And which one to get? =\
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...
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...
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;
...
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...
Good windows debugger for C? Microsoft Visual Studio ;D
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...
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...
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...