Median Function in C Math Library?
Is there any math function in C library to calculate MEDIAN of 'n' numbers? ...
Is there any math function in C library to calculate MEDIAN of 'n' numbers? ...
Hello, linux gcc 4.4.1 I have the following fprintf statement and I would like to have the OK as green and the FAILED as red. Is this possible? if(devh == -1) { fprintf(stderr, "Device [ FAILED ]\n"); } else { fprintf(stderr, "Device [ OK ]\n"); } Many thanks for any suggestions, ...
Rather than possibly reinventing the wheel (by "rolling my own") - I thought I'd ask in here first. Anyone knows where I can download a good C/C++ RESTful framework?. I have had a quick look on google, but there is nothing too impressive so far - maybe someone in here has written one already (that they dont mind sharing), or may know a ...
HI, I developed some mixed C/C++ code, with some intensive numerical calculations. When compiled in Linux and Mac OS X I get very similar results after the simulation ends. In Windows the program compiles as well but I get very different results and sometimes the program does not seem to work. I used GNU compilers in all systems. Some ...
I want to allocate shared memory as a 2D array using IPC. I tried the following: id_shmem = shmget(ipc_key, sizeof(int)*rows*columns, IPC_CREAT|0666); matrix = (int **)shmat(id_shmem, 0, 0); The problem is that whenever I try to write something into the matrix, I get a segment fault. ...
I'm a little confused over the concept of machine code... Is machine code synonymous to assembly language? What would be an example of the machine code in LC-3? ...
I'm trying to figure out the answer to this question with the following code, but it turns out, the value of the pointer (address of problem3 turned out to be so far away from the parameter and local variables of the function) where the hell is x = problem3; pointing to... void problem3(int a) { int overflowme[16]; int x = probl...
I'm looking to do some testing of loan calculations on the Mac. I know what an amortization schedule is, and yes, I know how to convert an algorithm into code, but I'm don't want to worry about screwing up the rounding, or reinventing the wheel. Are there any Open Source C or Objective-C libraries that handle such calculations? I know...
Hi all I'm a musician and a programmer and would like to create my own program to make music. I'll start with a console application in C++ before I make a GUI. I'm quiet new to C/C++ and know how to make a basic console application and have read about the Win32 API. I was looking into MSDN for multimedia in Win32 applications and I fo...
I am currently working on a compiler under C and I am abit lost at the part where we construct the data structure for AST, especially for the part where we construct stucture for IDs, it is called "Symbol Table Entry" I see structures over net such as: struct ste { struct id *name; /* pointer into hash table for assoc. id */ st...
I have several fastcgi processes that are supposed to share data. The data is bound to a session (a unique session id string) and should be able to survive a server reboot. Depending on the number of sessions, the shared data might be too big to fit into main memory. Ideally, in the case when the shared data exceeds a certain treshold, t...
hi every one this is my first time on Visual studio & this message "Note: C++ does not support default-int" keep showing pleas someone tell me what wrong with my C code #include <stdio.h> #include <stdlib.h> #include <time.h> void remplire (int t[] , int n ) ; void afficher (int t[] , int n ) ; void main () { const long_tab = 2000...
I've been writing an Apache module recently. It's been interesting to work with the memory pool paradigm, but I'm clearly not doing something right. I've got a segfault, and I cannot seem to find it. My current debug cycle involves ap_rprintfs and a make script that rebuilds and reloads Apache. What kind of tools are available for work...
hi, how to inform the server that is a client is interrupted, and close the socket? Thanks! ...
First of all, I am a beginner programmer (still much to learn). In one of my small school projects I have written a stack for a struct . Now I have a slightly different struct and I need a stack for this one too. Should I write another data structure [stack] (very similar to the initial one), or try to achieve some generic programming.....
Hi, I'm trying to enumerate some operators, my code line is : enum operations{+=4,-,%,<,>} when i'm trying to compile this line , gcc says : expected identifier before ‘+’ token So, how can I enumerate these operators. Can we use some escape characters for them ? ...
One can use poll/select when writing a server that can service multiple clients all in the same thread. select and poll, however need a file descriptor to work. For this reason, I am uncertain how to perform simple asynchronous operations, like implementing a simple callback to break up a long running operation or a delayed callback with...
I'm trying to extend Python interpreter by a few C functions I wrote. From reading docs, to expose those function the user has to import the module encompassing the functions. Is it possible to load pre-load or pre-import via C API the module so that the user doesn't have to type import <mymodule>? Or even better, from <mymodule> import...
Reading misc. tutorials related to SDL development I've found two different examples, doing the same thing, but in a different manner. I was wondering which of the two are you considering to be correct, judging from the perspective of code "security" and maintainability . In the first example the programmer isn't using assert at all, bu...
I want to create a shared memory between two process. I used fork(). A child tries to change this shared memory and mother creates another child so new child tries to change same memory so on. here is my code in C programing. (ubuntu) mylist ch=NUL; f=fork(); if(!f){ pba=shmget(KEYSHM,sizeof(char),0); /*created shared memory*/ ...