What's a better way to start a thread?
I'm trying to determine what are the advantages/disadvantages of _beginthread, _beginthreadex and CreateThread. All of these functions return a thread handle to a newly created thread, I already know that CreateThread provides a little extra information when an error occurs (it can be checked by c...
I was at an interview for a C position in which they presented me with an idiom that I haven't previously encountered. This is a trick that simplifies implementation of various algorithms involving linked lists and I'm wondering if anybody else has encountered this.
Say we have a linked list record defined so:
typedef struct _record
{
...
I need to generate calibration file* for the Gartrip program. Does anyone known where I can find the file format it uses or, better yet, code for generating them?
I'm not to picky on the language.
If no one point me at anything better, I'm working on getting some examples to reverse engineer. Shouldn't be to bad as I have reason to exp...
I'm looking for a bare bones simple example C app for unpacking a zip file using zlib. It must support fairly new version of .zip and must have source right down to the zlib calls.
...
I am precisely looking for the info like ,
TAP is for regression and TDD is for Unit Testing ... or
are they mutually exclusive( no need to use both of them ) ?
bonus for suggesting 'good' Unit Test Frame work for TDD in C (expecting to address good aspect as well :) )
finally cMockery (googles code) for Testing C code (not derived ...
Hi All,
What would the purpose of this construct in a c file be?:
#define _TIMERC
#include "timer.h"
#undef _TIMERC
I am aware of the guard for preventing multiple inclusion of a header file. This doesn't appear to be whats happening though.
thanks!
...
Could somebody tell me wich new dynamic tools analysis for C-code are there like valdgrind?
...
I'm not sure, will the visual c ++ compiler express edition work for compiling c and if not can someone link me to an easy c compiler to use. Thanks in advance.
...
There was a C program written for a contest that was formatted in ASCII art as a Japanese character. When compiled and ran it printed out another program formatted in a different Japanese character, then another, then finally it printed out the first again.
I was looking for the code to that and could not find it on the internet. I do...
I have written a console application that sets the size of the console and output buffer. My problem is that after the program ends I cannot resize my cmd.exe window the way I did before. After the program sets the size of the window it retains that size no matter what I do afterwards.
...
EDIT: I've tagged this C in a hope to get more response. It's more the theory I'm interested in than a specific language implementation. So if you're a C coder please treat the following PHP as pseudo-code and feel free to respond with an answer written in C.
I am trying to speed up a PHP CLI script by having it execute its tasks in p...
I know the rule-of-thumb to read declarations right-to-left and I was fairly sure I knew what was going on until a colleague told me that:
const MyStructure** ppMyStruct;
means "ppMyStruct is a pointer to a const pointer to a (mutable) MyStructure" (in C++).
I would have thought it meant "ppMyStruct is a pointer to a pointer to a con...
I am curious to know How the Loader Maps DLL in to Process Address Space. How loader does that magic. Example is highly appreciated.
Thanks in advance.
...
Session transcript:
>type lookma.c
int main() {
printf("%s", "no stdio.h");
}
>cl lookma.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
lookma.c
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. ...
I need to declare an array of pointers to functions like so:
extern void function1(void);
extern void function2(void);
...
void (*MESSAGE_HANDLERS[])(void) = {
function1,
function2,
...
};
However, I want the the array to be declared as constant -- both the data in the array and the pointer to the data. Unfortunately, I do n...
Taking advice from this post, I purchased a copy of 'The C Programming Language' and am happily reading my way through. However, all the stuff I've written in the past has been interpreted, and I have no idea where to look for a good C compiler or an IDE (is there even one?). Google searches throw up a lot of results for C++ compilers, w...
OK I'm just learning C with this book of Kernighan and Ritchie; I'm in the basics of the fourth chapter (functions stuff). The other day I came in curiosity with this function sleep(), so tried to use it like this:
#include <stdio.h>
#include <unistd.h>
int main(void)
{
printf(" I like cows.");
sleep(5);
return 0;
}
The problem...
I've never managed to move from unit-testing to integration-testing in any graceful or automated way when it comes to network code.
So my question is: Given a simple single-threaded client/server based network application, how would you go about integrating both client and server into your currently favorite testing suite (I currently u...
So I'm trying to run my first hello world prog written in C. I compiled it in eclipse and get no errors, but when I try to run it I get:
"This application has failed to start because cygwin1.dll was not found."
I found this post which seems to indicate I should add it to Windows PATH, and I used this to do that. So now "Path" in my env...
[This is for PC/Visual C++ specifically (although any other answers would be quite illuminating :))]
How can you tell if a pointer comes from an object in the stack? For example:
int g_n = 0;
void F()
{
int *pA = &s_n;
ASSERT_IS_POINTER_ON_STACK(pA);
int i = 0;
int *pB = &i;
ASSERT_IS_POINTER_ON_STACK(pB);
}
so o...