The question is probably not the best one to describe my issue but I couldn't think of a better one. My makefile goes like this:
PROGRAM_NAME = prog
OBJECT_FILES = $(PROGRAM_NAME).o
CFLAGS = -O2 -Wall -g
$(PROGRAM_NAME) : $(OBJECT_FILES)
gcc $(CFLAGS) -o $@ $(OBJECT_FILES)
$(PROGRAM_NAME).o : $(PROGRAM_NAME).c data.h
gcc $(CF...
All my searches returned nothing and I find it odd that there aren't any macros to use as file descriptors for read/write system calls for standard input and output instead of a 0 (stdout) and a 1 (stdin).
Am I missing them or they really don't exist?
...
Hey there,
I'ld like to analyze the certificate of a given url and get some details of it. Do you know any ways to do this? A command-line tool can be something like downloadSSLCert https://my.funny.url/ > certFile and then analyzing it for e.g. the fingerprint of the cert. It can be a command line utility, a c/c++/objective-c or java c...
I'm using the following code to write data through a named pipe from one application to another. The thread where the writing is taken place should never be exited. But if r_write() returns less than it should, the thread/program stops for some reason. How can I make the thread continue once write has returned less than it should?
ssize...
I've got the following two programs, one acting as a reader and the other as a writer. The writer seems to only send about 3/4 of the data correctly to be read by the reader. Is there any way to guarantee that all the data is being sent? I think I've got it set up so that it reads and writes reliably, but it still seems to miss 1/4 of th...
I'm looking for a robust face detection algorithm/library, preferably in C (C++ is okay too; other languages I can port if necessary). I've used OpenCV's implementation in the past, but I don't think it's invariant to rotation. Doesn't need to be real-time, but it shouldn't be horrendously slow either (maybe one or two seconds per photo ...
I need to make sure that explorer.exe runs as a system shell. What I need to do is:
Overwrite the current shell (Winlogon\Shell) with explorer.exe
Run explorer.exe (as shell)
Overwrite the current shell with my own shell.
Between the last two steps is a race:
If I overwrite the current shell with my own shell too quickly, only "My ...
I'm looking to obtain my own IP Address in order to publish that information in to a Peer-to-Peer network. In POSIX/C we have getaddrinfo(NULL, ...), but this always seems to returns INADDR_ANY or INADDR_LOOPBACK, which is useless to me.
Any suggestions?
...
Possible Duplicate:
In C arrays why is this true? a[5] == 5[a]
Is the possibility of both array[index] and index[array] a compiler feature or a language feature. How is the second one possible?
...
Guys, I want to know if float variables can be used in sprintf() function.
Like, if we write:
sprintf(str,"adc_read = %d \n",adc_read);
where adc_read is an integer variable, it will store the string
"adc_read = 1023 \n"
in str (assuming that adc_read = 1023)
How can I use a float variable in place of integer?
...
Does the "C" standard support something similar to __func__ for the function arguments' names?
...
Hey everyone!
Could someone please help me understand this error in C for structures?
This is my code:
struct Orientation
{
char facing;
char sensor;
char mazeDir;
};
struct Orientation O[16];
O[0] = {'N', 'F', 'N'};
O[1] = {'N', 'B', 'S'};
O[2] = {'N', 'R', 'E'};
O[3] = {'N', 'L', 'W'};
O[4] = {'S', 'F', 'S'};
O[5] = {'S'...
In the mold of a previous question I asked about the so-called safe library deprecations, I find myself similarly bemused as to why fopen() should be deprecated.
The function takes two C strings, and returns a FILE* ptr, or NULL on failure. Where are the thread-safety problems / string overrun problems? Or is it something else?
Thanks ...
Hi there,
I'm receiving from socket A and writing that to socket B on the fly (like a proxy server might). I would like to inspect and possibly modify data passing through. My question is how to handle border cases, ie where the regular expression I'm searching for would match between two successive socket A read and socket B write iter...
I'm playing with waitpid() and signal() and I'm looking for reliable test cases for returning WIFSIGNALED(status) = WIFSTOPPED(status) = WIFCONTINUED (status) = true but can't find any...
Care to tell me how can I make sure those return true so I can debug my code?
Also, a few hints about what signals should I catch with signal() to te...
I just hope the following doesn't seem to you like redundant jabber :)
Anyway, there is that:
for (p = fmt; *p; p++) {
if (*p != '%') {
putchar(*p);
continue;
}
switch (*++p) {
/* Some cases here */
...
}
}
And I wondered why the writer (Kernighan / Ritchie) used the continue in the if ...
I have the following code:
#include <string.h>
int main(void) {
char *buffer = NULL, **words = NULL, *aPtr = NULL, *sPtr;
int count = 0;
buffer = strdup("The quick brown fox jumps over the lazy dog");
sPtr = buffer;
do {
aPtr = strsep(&sPtr, " ");
words[count++] = ... // missing code
} while(aPtr);
...
My objective is to have an event that is triggered when a website is accessed.
Now, maybe through the window title, or the text in the window. Or maybe even reading a URL.
As of now I am aware of FindWindow (class,title);
However all attempts to put this line of code into a loop and it's exit condition being when the window appears hav...
I have a file I'm writing to and then changing the size of it to the size of text written to it something like:
FILE * file...
I get all the data from the file and change the file's size to the data's size but it differs. The string's size is smaller then the filelength and it cuts it and loses data.
What might be the problem?
while(...
I have a folder named 'X'. In X I have two subfolders named 'src' and 'include'.
The 'src' folder contains a C file 'main.c', and the 'include' folder contains a file 'main.h'.
I want to write a makefile to build these files(from folder X) in windows command prompt.
I have tried a lot but with no effect.
First of all I need the make fi...