I'm not looking for a different language to use, if I was I would just use Python. The thing is I've gotten so use to using the simple string operations in Python that now that I have to do some C...
Type: Posts; User: samps005
I'm not looking for a different language to use, if I was I would just use Python. The thing is I've gotten so use to using the simple string operations in Python that now that I have to do some C...
I was looking for a different string library to use then the standard c one, or maybe just some simple wrappers for some of the c string functions. I did some searches and came up with a few...
http://www.ecst.csuchico.edu/%7Ebeej/guide/net/
when talking about algorithm complexity, you usually do not bother multiplying the complexity by constants.
That program is O(1) because it takes a constant amount of time to do the calculation.
...
I decided that it would probably help to have the code, so I will attach it here.
I am not sure if this belongs here or in the C board.
I have been writing a simple server program.
When a user connects I create a new thread to handle the user.
There is another program that is...
what is the best way to make a copy of a stuct,
so that they hold the same information, but are stored in
seperate chunks of memory?
yeah, I need the file pointer most of my other code needs it. Does anyone else know of a function to get a file descriptor from a file pointer? Or maybe just another really simple way to lock a...
sorry, I did read the man page for it, I just didn't catch that is was asking for a file descriptor.
is there anyway to get the file descriptor from the file pointer?
I am making a call to flock() and getting the error
" warning: passing arg 1 of `flock' makes integer from pointer without a cast"
when I try to compile. I am running FreeBSD and using gcc.
...
you could declare it like
char argument[20]
then you could break up the argument string into two strings using strtok() or index(), check the man pages for more info on those. I try not to use...
this may not be the smartest way, but it will work
I would guess that a variable will never start with a number,
so just test to see if the first part of the variable is a number and if it is...
not sure if this is what your trying to do
but If you just want to exit your thread at some time try
pthread_exit(NULL);
this will exit the thread but not the rest of the program.
The NULL...
buf is declared like
char buf[100];
I am reading into it from a socket using recv()
does anyone know of common reasons to get seg faults with strcmp
I am reading a string of characters into a buffer, When I try to compare that buffer with the string "BYE" I get a seg. fault.
I...
it is something like this, but of course without the object stuff. This should at least give you the basic idea then you can write it in plan C.
void printBFS(Node root)
{
Queue Q =...
as far as I know it is always left to right for all infix notation
one sugestion I would have is that for simple program like that is to not us scanf. scanf can be tricky sometimes and if you just starting off you better off trying something else. if you want...
I do similar operations in matlab when dealing with matrices. The simplest way to store a diagonal matrix is to just store the diagonal in a single dimension array. so every none zero element will...
thanks for your response.
I was able to reduce the operation time to about 10% of the original time by manualy unrolling the loops in steps of three for the middle loop and steps of 16 for the inner...
I'm using gcc and running on linux. pentium III
I'm writting some functions that need to multiply large matrices together. This is what I have so far for it. It works fine, but it runs to slow. I need to run this function a lot so it needs to...
Does anyone know of debugging programs like gdb, but more visual. I'd like to keep track of several things at once and I was just wondering if there is a way to do this without having to ask again...
does anyone know of another way to write !(x)
x being a 32 bit int.
thanks, I wasn't really expected some one to just give me the code. I don't completly understand how the masking is working, but I'll have to break it down at it and figure it out.