c

Less than 16 bits int in C ?

Possible Duplicate: Any guaranteed minimum sizes for types in C? Is there a computer architecture in which the type int in ANSI C can instantiate a variable with less than 16 bits, or 16 bits is the minimum length in any architecture? ...

gedit plugin development in C

I'm Interested in writing gedit-plugins in C. I've checked http://live.gnome.org/Gedit/NewMDIPluginHowTo ...but haven't had any luck with it. How can I get more information about writing gedit plugins in C? Any help will be appreciated. Thanks in advance. ...

C++ integration with Java in one project. Is it possible and how to do it?

So... I will have a project which will be tested on Win 7 and some Linux server. It will be a web service that will use HSQLDB, Hibernate, Spring, Blaze DS and Flash (Flex RIA) as front end. I need to implement into it some image filtering\editing functionality which will be implemented in cross-platform C++ code (It will use Open-CV) w...

snprintf overflows and prints garbage to file randomly. help

Here is my code, basically one the 4 computer I have tested it on they all work perfectly with very large data sizes, eg textfiles up to 500mb in size, but when I run them on the server with real data even files as small as 6mb seem to overrun somewhere and writes garbage to the end of my files. Here is the source of the entire function...

How to pass parameter to a function from Assembly to C

I am using HCS08 and Code Warrior. I am calling a C function from assembly. How can I pass parameter to this C function? ...

C function calling

So this program is supposed to estimate hourly temperatures throughout a day after being given the daily high, low and the hour which the low is expected. I am having problems calling up my functions inside the main function. I don't really understand how I am supposed to get specific information from the functions, and use it in place o...

In C, how can I create a file from a filepath, even if the directories are not existing?

I am taking a file path from a user. I need to then access that file, and create it if it does not exist. I also need to create any intermediate directories if they don't exist as well. For example, if my directory looks like: mydir | +---subdir | | | +-- FileA | +---File1 I might receive mydir/subdir/FileA and would then access ...

SendMessage WM_MOUSEMOVE not working as expected

When sending the WM_MOUSEMOVE message to the client area of an application (in this case Open Office Writer) the image will flicker as if the mouse is over the specified coordinates, but does not stay in that state. The code is: PostMessage(hWndClient, WM_MOUSEMOVE, 0, MAKEWORD(x, y)) where x and y are relative to the client area. S...

how do I balance my binary tree

Hi, I already have a working binary tree database. Unfortunately, it needs to have the ability to balance itself. I don't want to rewrite the whole thing, I just want to include a function that will balance the tree. Any algorithms or ideas? ...

CodeBlocks MinGW on XP noob. Is it possible to overwrite the same exe every time I compile? Further explanation inside...

I have looked through both the CodeBlocks and MinGW FAQ and wiki to no avail. As stated above I am a noob. I want CodeBlocks to act like a Unix compiler in that it overwrites a single output file every time it compiles unless told to do otherwise. In Unix: [cc example.c] -> [a.out], [cc example2.c] -> [a.out]. If I want to save the ou...

Using pthread_create stops my method from working. Why? Using C.

I have a method which is is meant to write information into a struct. I want to make it run as a thread. If I call it by itself, as childWriter((void*) &sa) it works. If I call pthread_create(&writerChild, NULL, childWriter, (void*) &sa), it no longer works. It doesn't write to the shared object. This is driving me mad. Why isn't it w...

php passing c struct data throught socket programming

Dear All, How to make a php socket client that needs to perform socket_sendto to linux C socket server which has following struct typedef struct { UI2 todo; char rz[LNG_RZ + 1]; char saId[LNG_SAT_ID + 1]; char user[LNG_USER + 1]; char lang[LANGLEN + 1]; SI4 ...

iPhone file IO in pure c/posix style

Hi, is there a way to write files to the iphone file system using only pure c code and some posix like api? I only found some Objective-C/Cocoa stuff out there and I think that I can't just mix some Objective-C code snippet into the .c file. ...

Implementing the fair-coin flip

I was getting bored so I started looking a little into Cryptography. I got interested in this Fair-Coin Flipping protocol. This protocol works with public key cryptography but requires that the algorithm commute (something like RSA I guess). I thought it would be fun to write this in either C or C++ and was wondering how people generally...

Shared Data Problem

I have 2 functions. void fn1() and void fn2(). Both the functions are using the same data say int i; Both the functions are executed simultaneously by 2 different processes. Then how should the variable i be protected such that 1 function should not be allowed to change i until the other changes something like locking the variable i and...

How to read a .txt file or a .csv file from C program?

Could anyone help me by guiding me as how to read a .txt file or a .csv file from C program. I mean which C function is suitable for reading operation? Actually my .txt or .csv file has a fixed pattern shown below: Temperature = 35 Pressure Segment 1 Slope = 5.5 Offset = 10 Temperature = 100 Pressure Segment 1 Slope = 53 Offset = 12 T...

Why can we delete arrays, but not know the length in C/C++?

Possible Duplicate: C programming : How does free know how much to free? How is is that it is possible for us to delete dynamically allocated arrays, but we can't find out how many elements they have? Can't we just divide the size of the memory location by the size of each object? ...

event-driven finite state machine + threads : how to ?

Hello I would like to model an event-driven finite state machine in C as proposed here : http://en.wikipedia.org/wiki/Event-driven_finite_state_machine But I would also like the 'external' events to be handled in various threads. Can I find such a code somewhere ? Or advices ? Thx JCLL ...

Help with gcvt function in C?

void main() { char buffer[40]; float x=1.2f,y=.2f; printf("%f",(x/y)); printf( "\n%s\n", gcvt( x/y, 30, buffer ) ); } The second printf gives result as 6.0000001490116102.I expected the answer to be 6.0000...full zeros. ...

Precision loss in gcvt function call

How does gcvt function in c convert float to string?Please explain the precision losses that can occur in this process. ...