Wanna go back to Indonesia, but its so damn expensive, any donations would be appreciated :P hehe
11 Posted Topics
Re: Just make a server with ServerSocket listening in on a port specified by you. and the client will connect to this server socket and send some data through the socket. Http server is also just like any other server but it listens on port 80 and only accepts Get and … | |
Server Code [CODE]import java.io.DataInputStream; import java.io.DataOutputStream; import java.net.ServerSocket; import java.net.Socket; /** * * @author efron */ public class Server { public static void main(String[] args) { try { ServerSocket serverSocket = new ServerSocket(Integer.parseInt("49999")); System.out.println(serverSocket.getLocalPort()); while (true) { System.out.println("Waiting for Client...(port = " + 49999 + ")"); Socket acceptSocket = serverSocket.accept(); … | |
the problem is if you increase buff size and also change the buff size in a3_fgets_2 function call to more than 15, the program will run in an infinite loop, Can anybody tell me why? Thanks [CODE]#include<unistd.h> #include<string.h> char * a3_fgets ( char * str, int num, int fd ); … | |
I was doing a projecteuler problem. I made a program that would find all the prime numbers under 1000000 and write them all in a file. Why is that if I use the file name as "primes.txt", the result is gibberish from beginning to end, but when I use "primes.dat", … | |
I dont have any idea what the problem is. But what I know is it stopped at fgets(temp, 256, stdin); when I run the program, it runs this line and then just stopped because of a segmentation fault. The silly printfs are just for me checking where it stopped exactly. … | |
There is a problem I am having inside the AddToEnd function. At this line: [QUOTE]*ptrL->ptrNext = ptrInput;[/QUOTE] it gives this error: [QUOTE]lab8.c: In function ‘AddToEnd’: lab8.c:105: error: request for member ‘ptrNext’ in something not a structure or union [/QUOTE] Can anybody tell me why? P.S. I realized that I do … | |
I have already included string.h, I've even tried defining GNU but I still get the same warning/error when I compile it. below is not really code, its the warning/error I get [CODE]bravo:~/60-141/Assignment/Assignment3>cc assign3.c "assign3.c", line 94: warning: implicit function declaration: strndup Undefined first referenced symbol in file strndup assign3.o ld: … | |
Hi this is an assignment for my computer science lab. It is weird because if I compile and run with my c compiler from ubuntu gcc4.4, it works perfectly. But if I compile with the university's server (I connect with SSH) it messes up The main purpose of the program … | |
The problem is I use malloc in the last function(toString()). I just wanna know if there is anyway to free it? or that I dont have to? Thanks [CODE] #include<stdio.h> #include<string.h> #include<stdlib.h> #include<ctype.h> /* Function prototypes */ void process(char input); void update(char words[][51], int position); char * toString(char character); /* … | |
I have been racking my brains to find what's wrong with my code... been playing with it for an hour or so but it seems to still be wrong.. Please anyone can point out the mistake? Im so frustated right now.:yawn: the answer to the question is 21124, but this … |
The End.