Hello
Can anybody please post some example code on how I can reread a configuration file and restart my daemon after the daemon receives a SIGHUP signal. The daemon is a user space program written in C on Linux and is not started by inetd.
...
I`m trying to create a macro which would make easier to point to a structs member. Currently i am pointing to a structs member in assembly file using the STRUCT_NAME + offset method.
For example if i want to point structs third member,i would have to do it like this: STRUCT_NAME + 3.
This seems stupid way to do it, and if i insert mor...
Possible Duplicate:
Container Class / Library for C
We have to maintain and even develop C-code of our legacy system. Is there good collection library that would support Java/C# (new versions) style collections. Hashtable, HashSet, etc. Of course without objects, but with structs. The HashTable key limitations to "strings" and...
I am trying to write 2 server/client programs under Linux, in which they communicate through named pipes. The problem is that sometimes when I try to write from the server into a pipe that doesn't exist anymore (the client has stopped), I get a "Resource temporarily unavailable" error and the server stops completely.
I understand that ...
My php script communicates over TCP with C server, is there a way to present data obtained from the server while it does not refresh the entire page, so the data refer to a ajax script?
...
What is the delay load equivalent in unix based system.
I have a code foo.cpp, While compiling with gcc I link it to shared objects(totally three .so files are there.).Each of the .so file for different option.
./foo -v needs libversion.so
./foo -update needs libupdate.so
I need the symbol for those libraries should be resolved only a...
Hello,
I am trying to use md5 code to calculate checksums of file. Now the given function prints out the (previously calculated) checksum on screen, but I want to store it in a variable, to be able to compare it later on.
I guess the main problem is that I want to store the content of an array in one variable.
How can I manage that?
...
I already know the differences between a header file and a library. However, when I'm writing my makefile, I have some difficulties on deciding if I should put something as a dependency of the file or just at the linking rule.
For example: I have 2 simple files:
main.c:
#include <stdio.h>
main(){
printf("this is the sine or 90");
s...
I was playing around with C, anyways I was thinking how can file pointer (which points to a struct type), be tested if NULL as for instant:
FILE *cfPtr;
if ( ( cfPtr = fopen( "file.dat", "w" ) ) == NULL )
I tried to do that myself, but an error occurs.
struct foo{
int x;
};
struct foo bar = {0};
if (bar == NULL)
puts("Yay\n...
Hello all,
I am developing a computer vision program using OpenCV (IDE = devcpp). I am able to get the hand contour , move cursor position according to our our hand. i want to implement right click functionality .Please help me with it .
i am using event SetCursorPos(x,y) to set the cursor position on the screen.
is there any simple f...
I'm attempting to write a wrapper so that my C# application can use a DLL written in C.
Here is a method defintion that i'm trying to wrap:
void methodA(const uint32_t *data); //c header declaration
The issue I'm having is trying to figure out how to give a equivalent pointer from c#. In c# I want it to operate on a:
UInt32 data[] ...
Hi,
I had a problem with a part of my code, which after some iterations seemed to read NaN as value of a double of a struct. I think I found the error, but am still wondering why gcc (version 3.2.3 on a embedded Linux with busybox) did not warn me. Here are the important parts of the code:
A c file and its header for functions to acqui...
is it possible to write a single character using a syscall from within an inline assembly block? if so, how? it should look "something" like this:
__asm__ __volatile__
(
" movl $1, %%edx \n\t"
" movl $80, %%ecx \n\t"
" movl $0, %%ebx \n\t"
...
Hi,
I can store string of few length in char data type.
But when it exceeds its capacity what can be the alternative way to store string.
I am using char data type.
void setString(char* inPoints)
{
if (strcmp(mPoints, inPoints)!= ZERO) {
if (mPoints) {
free(mPoints);
}
mPoints = (char*)malloc((strlen(inPoints)...
In http://stackoverflow.com/questions/2906365/gcc-strict-aliasing-and-casting-through-a-union I asked whether anyone had encountered problems with union punning through pointers. So far, the answer seems to be No.
This question is broader: do you have any horror stories about gcc and strict-aliasing?
Background: Quoting from AndreyT's...
Hi,
In my program, I have a list of "server address" in the following format:
host[:port]
The brackets here, indicate that the port is optional.
host can be a hostname, an IPv4 or IPv6 address (possibly in "bracket-enclosed" notation).
port, if present can be a numeric port number or a service string (like: "http" or "ssh").
If p...
Is there any C\C++ Cross-platform library for sharing data between app's?
...
I'm trying to allocate memory for a multidimensional array (8 rows, 3 columns).
Here's the code for the allocation (I'm sure the error is clear for you)
char **ptr = (char **) malloc( sizeof(char) * 8);
for (i = 0; i < 3; i++)
ptr[i] = (char *) malloc( sizeof(char) * 3);
The crash happens when I reference this:
ptr[3][0];
...
I know it's simple, but I can't seem to make this work.
My function is like so:
int GefMain(int array[][5])
{
//do stuff
return 1;
}
In my main:
int GefMain(int array[][5]);
int main(void)
{
int array[1800][5];
GefMain(array);
return 0;
}
I referred to this helpful resource, but I am still ...
My basic problem is that I want to use some structs and functions defined in a header file by not including that header file in my code.
The header file is generated by a tool. Since I don't have access to the header file, I can't include it in my program.
Here's a simple example of my scenario:
first.h
#ifndef FIRST_H_GUARD
#define ...