I was looking through the DXUTCore project that comes with the DirectX March 2009 SDK, and noticed that instead of making normal accessor methods, they used macros to create the generic accessors, similar to the following:
#define GET_ACCESSOR( x, y ) inline x Get##y() { DXUTLock l; return m_state.m_##y;};
...
GET_ACCESSOR( WCHAR*, W...
I'm a BIG blog reader. I can't stop reading blogs. Blogs helped me find this site (in particular Jeff's blog). However I've come to realize that all the blogs I read deal with one language.
Coding Horror
Fabulous Adventures In Coding
Jon Skeet's Blog
Scott Hanselman's Blog
Did you guess the language?
Well now I'm learning C and usi...
I am currently setting up a new software project and I want to have an automated build system. The project has a fairly complex involving C, C#. It must also generate automatic bindings (Python, PHP, Java, Ruby, etc.) using an external tool (SWIG).
The project should be able to built, and run in Linux, Windows, and possibly Mac OS X.
I...
I came across the following function signature and I wondered if this (the ellipsis, or "...") is some kind of polymorphism?
#include <fcntl.h>
int fcntl(int fd, int cmd, ... );
Thanks in advance.
...
Since ldd lists only the dynamic libraries.
Is there a way to extract the info. about static libraries used to create the executable ?
TIA,
Saurabh
...
To this bit of code I pass the string "kellogs special k" and I get 1 which means that the string is an integer. What on earth am I doing wrong? Or is it a GMP problem?
#define F(x) mpf_t (x); mpf_init( (x) );
long __stdcall FBIGISINTEGER(BSTR p1) {
USES_CONVERSION;
F(n1);
LPSTR sNum1 = W2A( p1 );
mpf_set_str( n1, sNum1, 10 );
re...
Using a vendor provided cross-compiling toolchain (apparently an OpenEmbedded derivative), I'm unable to embed the absolute path to third-party (open source, compiled in house)libraries. With the following gcc command line:
arm-linux-gcc test_connect_send.o gprs_connect.o \
/package/host/myvendor.com/API-R-2.0.0/Release/Libraries/li...
I want to make a virtual allocator using c++ on windows,, which allocate data on a file on the hard disk, to reduce physical memory usage when allocate large objects !..
I don't want to use system virtual memory with virtualAlloc.. . I want to create a file on the disk and use it to allocate the whole objects and then move the part or th...
I am running some profiling tests, and usleep is an useful function. But while my program is sleeping, this time does not appear in the profile.
eg. if I have a function as :
void f1() {
for (i = 0; i < 1000; i++)
usleep(1000);
}
With profile tools as gprof, f1 does not seems to consume any time.
What I am looking is a ...
since I couldn't find an answer to this question I researched a bit further into the MSDN and I found isChild(). It might give me the answer to that other question.
Now, in order to use isChild() I need to pass the HWND of the parent application that I want to check, in this case my own application.
How do I get the HWND of my own appli...
guys,
had been years since I wrote my last line in C, now I'm trying to start again to make some function and use than as an extension for php.
this is an easy function to create "small urls"
lets say:
a0bg
a0bf
a0bh
the problem I'm having is when I have to "increment" an string like zzz then I got: Bus Error
otherwise if I increme...
Most winsock tutorials on the net are preety much basic, and become useless once you got some more serious questions as to the internals of the system. MSDN is somewhat more inshightful, but tends to be preety minimalistic and sometimes ambigious.
Can you recommend some good reading materials, books or articles, that really cover the su...
Hello All,
Not been able to figure out why recvmsg() blocks when i try this test app on ubuntu.
http://web.mit.edu/kolya/misc/break-chroot.c
thanks
...
I am having trouble assigning the value of an NSString to a char * within a structure of a singleton class. The following is a simplification of my problem. My code utilizes more fields in the structure and passes more NSStrings.
Say I have a singleton class "SingletonClass" with a structure (I've done my homework with the Apple Documen...
Edit: For reference purposes (if anyone stumbles across this question), Igor Ostrovsky wrote a great post about cache misses. It discusses several different issues and shows example numbers. End Edit
I did some testing <long story goes here> and am wondering if a performance difference is due to memory cache misses. The following cod...
I'm looking for a way to get hold of network stats in C on Linux and MacOSX. Specifically, I need to monitor the number of bytes uploaded and downloaded from each network adapter on the system - I don't need to do packet inspection, or differentiate between protocols, just a 'total bytes' counter which I can poll at intervals would be fi...
Hello,
I wanted to have a look at the implementation of different C/C++ functions (like strcpy, stcmp, strstr). This will help me in knowing good coding practices in c/c++. Could you let me know where can I find it?
Thanks.
...
Hi,
I am writing a small academic research project about extremely long functions. Obviously, I am not looking for examples for bad programming, but for examples of 100, 200 and 600 lines long functions which makes sense.
I will be investigating the Linux kernel source using a script written for a Master's degree written in the Hebrew ...
I need a book that deals with implementing real projects in C, in contrast to "C Programming Language" which I recently finished reading and mastered, that only teaches the language. Something that deals with advanced topics such as: how to organize the source files, how to organize headers, more advanced preprocessing directive like #if...
How do I get similar functionality to the host command using a c api (or any other language for that matter)? I need more information than just an IP address given by gethostbyname(); specifically, the SMTP-related data.
...