Hi, as it seems there is no scripting language for windows mobile devices that gives access to phone (sms, mms, make a call, take photo) I wonder how complex would it be to make a python library that would enable that (write something in C, compile, and import in pythonce).
Question: where shall start to understand how to compile a pyth...
We use a simple object model for our low level networking code at work where struct pointers are passed around to functions which are pretending to be methods. I've inherited most of this code which was written by consultants with passable C/C++ experience at best and I've spent many late nights trying to refactor code into something tha...
struct elem
{
int i;
char k;
};
elem user; // compile error!
struct elem user; // this is correct
In the above piece of code we are getting an error for the first declaration. But this error doesn't occur with a C++ compiler. In C++ we don't need to use the keyword struct again and again.
So why doesn't anyone update their C compile...
I have a project that I thought was going to be relatively easy, but is turning out to be more of a pain that I had hoped. First, most of the code I'm interacting with is legacy code that I don't have control over, so I can't do big paradigm changes.
Here's a simplified explanation of what I need to do: Say I have a large number of si...
While cruising through my white book the other day, I noticed in the list of C keywords.
entry is one of the keywords on that list.
It is reserved for future use. Thinking back to my Fortran days, there was a function of some sort that used an entry statement to make a second argument signature, or entry point into a function.
Is this...
I'm a complete Ada newbie, though I've used Pascal for 2-3 years during HS.
IIRC, it is possible to call Pascal compiled functions from C/C++. Is it possible to call procedures & functions written in Ada from C++?
...
I'm new to the VxWorks environment, I'm wondering what C and C++ compilers are available for use with VxWorks?
...
This is going to sound like a silly question, but I'm still learning C, so please bear with me. :)
I'm working on chapter 6 of K&R (structs), and thus far through the book have seen great success. I decided to work with structs pretty heavily, and therefore did a lot of work early in the chapter with the point and rect examples. One of ...
Let's say I have a char* str = "0123456789" and I want to cut the first and the last three letters and print just the middle, what is the simplest, and safest, way of doing it?
Now the trick: The portion to cut and the portion to print are of variable size, so I could have a very long char*, or a very small one.
...
I remember some rules from a time ago (pre-32bit Intel processors), when was quite frequent (at least for me) having to analyze the assembly output generated by C/C++ compilers (in my case, Borland/Turbo at that time) to find performance bottlenecks, and to safely mix assembly routines with C/C++ code. Things like using the SI register f...
"C Interfaces and Implementations" shows some interesting usage patterns for data structures, but I am sure there are others out there.
http://www.amazon.com/Interfaces-Implementations-Techniques-Addison-Wesley-Professional/dp/0201498413
...
In the C language, using keyboard interrupt, how can I display an alternate key from what the user typed? E.g., when I press 'Q' on the keyboard, then the screen should display 'A'.
...
When trying to compile a file that include winnt.h via windows.h, I get the following error:
MyGl.cpp
..\microsoft sdks\windows\v6.0a\include\winnt.h(964) : error C2988: unrecognizable template declaration/definition
..\microsoft sdks\windows\v6.0a\include\winnt.h(964) : error C2059: syntax error : 'typename T, size_t N>
char (*RtlpNumb...
I've been looking around, but I can't seem to find a message-passing concurrency (Actor) library for C (not C++). Ideally the candidate would be based on something like libevent underneath allowing for non-blocking I/O in most places. Does anyone know of such a library?
...
void addNewNode (struct node *head, int n)
{
struct node* temp = (struct node*) malloc(sizeof(struct node));
temp -> data = n;
temp -> link = head;
head = temp;
}
The code give above is the popularly wrong version of a function for adding a new node at the head of a linked list.
Generally the correct versions are like,
...
I have a const char arr[] parameter that I am trying to iterate over,
char *ptr;
for (ptr= arr; *ptr!= '\0'; ptr++)
/* some code*/
I get an error: assignment discards qualifiers from pointer target type
Are const char [] handled differently than non-const?
...
Hi,
I'm currently reaching the end of working through the K&R book "The C Programming Language", and I'm looking for things to read next.
Any recommendations of:
blogs
more detailed / advanced books
(I've already stuck Advanced
Programming in a Unix Environment on
my Safari bookshelf)
open source
code (beginner-friendly and with
goo...
Hey!
I've been seeing that expression for over 10 years now. I've been trying to think what it's good for. Since I see it mostly in #defines, I assume it's good for inner scope variable declaration and for using breaks (instead of gotos.)
Is it good for anything else? Do you use it?
...
So I'm building an app that uses win32's SendMessage as IPC.
I'm using FindWindow to get the hWnd based on className and windowName. This has all being going fine and dandy until I want to talk to a root (as in child of the desktop) Window that has the same name / class name as other root Windows.
Is there an alternative to FindWindow ...
POSIX environments provide at least two ways of accessing files. There's the standard system calls open(), read(), write(), and friends, but there's also the option of using mmap() to map the file into virtual memory.
When is it preferable to use one over the other? What're their individual advantages that merit including two interfac...