c

The Why and the How of Creating a Watchdog in Cocoa/Objective-C

Happy Monday to you all! Here is my situation. Any assistance greatly appreciated! I have created an executable that when installed gets placed in the Launch Agents folder of the machine. In theory it should run perpetually, collecting data every second. It can stop when the machine is asleep, but restart when the computer is reactivat...

How can find using c-program whether my machine is 16-bit or 32-bit or 64-bit

Can somebody give simple c-program to find whether my machine is 16-bit or 32-bit or 64-bit ? ...

Using "C" function and variables in "C++" code

Hi, I need to call "C" function which is having one argument variable "struct" (which is defined in "C" file), from "C++" file. I used 'extern "C"', but getting linking error. Please suggest me some way to do it ? Thanks Priyanshu ...

Standard C header for ANSI VT100 escape sequences

Is there a standard C header containing ansi escape sequences for say vt100 ? ...

C: Is the inline keyword worth it ?

Is it worth it to use the inline keyword or the compiler is smart enough to know when he needs to inline a function ? ...

Problem with SetComputerName Function

I used following line of code to change my computer name: std::string mystr="MY-PC" bSuccess = SetComputerNameA(mystr.c_str()); if( bSuccess == 0 ) printf("Unable to change computer name | ERROR %d |", GetLastError()); else printf("Name changed successfully"); Upon executing the program, 'Name changed successfully' message...

How to convert objective C array to a C array?

I have NSArray in Objective C, which store int only. How can I convert it to C array? Thanks. My Objective C array: NSArray *myArray = [[NSArray alloc] initWithObject:@"1", @"4", @"8", nil]; ...

Tell me what the compiler does here?

Hi.. Please tell me what it does? $ ar -r libsldap.a ...

Switch-Case Operator -- C

Is there a way to store user inputs in switch case from one operation and use it across switch operations at run-time. Example: If its a software for a Bank and I want to take information from the user and validate if his a/c number is correct and also check if he has enough bank balance to withdraw money. I need to know how to store t...

Why does a Daemon randomly stop?

Hello, This is sort of related to a previous, yet so far unsuccessful question of mine. I have a daemon that is placed in the LaunchAgents folder (on Mac) and it should run perpetually in the background, but after a couple of days it just stops for no apparent reason. I have no idea why and thus my question: What are the reasons that a...

Memory Optimization for child processes

I work on Linux for ARM processor for cable modem. There is a tool that I have written (as the job demands) that sends/storms customized UDP packets using raw sockets. I form the packet from scratch so that we have the flexibility to play with different options. This tool is mainly for stress testing routers. The details are here. I ac...

Collision detection between 2 rotated cubes

Possible Duplicate: Collision detection between two general hexahedrons Right now I do collision detection by finding the min and max and doing bounding box check. Unfortunately, my player cube rotates with the camera and this makes for some annoying results when the player is at a 45 degree angle. The constraints are that eac...

Compiling C to use the CLR

Possible Duplicate: Compiling C code for .NET I have a bunch of C source code and I want to compile it so it uses the .NET framework. I downloaded Microsoft Visual C++ and chose new CLR project. I then added all my C code, and I tried to compile the files. It said cl : Command line error D8045: cannot compile C file '..\..\...

Berkeley DB and C++ benchmark example?

Hi there! I'm trying to run benchmarks with a little berkeley db and c++ code, just for research purposes. Currently I'm testing with the following code. I'm filling the recors only with incrementing integers (I omitted things like error handling for better readability) (db is my own berkeley db class) // Open the database db.open( NU...

impossible constraint in 'asm'

Hi, I'm using third party library which compiled one week ago. Today I sat down at the desk again, i pushed build again, then my head blown out. I've been shot with this error: impossible constraint in 'asm' The code is: static inline unsigned ROLc(unsigned word, const int i) { asm ("roll %2,%0" :"=r" (word) :"0...

Collision detection between a capped cylinder and an AABB?

I'm making a game where the player is an upright capped cylinder, and the world is axis aligned bounding boxes. Given this, how could I check if the cylinder is intersecting a box? Thanks ...

Linux tool to check spelling of comments in c/c++ source code

What software do you suggest to check spelling of comments contained in c/c++ source code (especially doxygen comments)? I'm looking something that will parse only comments so I can easily find mistakes and correct them. The question is general but to be more specific - I'm using CodeLite IDE. ...

Why does this C program give unexpected output?

Possible Duplicate: C programming: is this undefined behavior? #include<stdio.h> main() { int i=5; printf("%d%d%d",i,i++,++i); } my expected output is 556. But when i executed it the result is 767. how? ...

Socket Programming in c

I have created small socket programs (client/server). Client will transfer all formats of files to server.The problem i am facing now is - I read mp3 file in binary mode and sent to the server. Server reads the content from the buffer and create a file.But when i am trying to open the file, it not getting open. But size remains same as o...

How to execute Python script from C code using EXECL?

I would like to know how I can execute a Python (or Lua etc) script from my C code using execl (or similar)? The following is some "parent / child" code showing how I am sending a STREAM of data to the child using PIPES. The code may not be perfect but you get the idea. Note the execl at the bottom: #include <sys/types.h> #include <st...