Hi,
I have a pure C application that issues IOCTL calls to my adapter driver and displays info ,this is however compiled using Visual Developer Studio 5(non-managed code) ... I need to get some info however from my adapter using WMI .... My googling efforts show that i would need to write a C++ Application using COM to achieve any fo...
Why does the following code give me a segmentation fault?
#define MAXROWS 10
#define MAXCOLS 10
void getInput (int *data[MAXROWS][MAXCOLS]) {
int rows, cols;
int curRow, curCol;
printf ("How many rows and cols?");
scanf ("%d %d", rows, cols);
for (curRow = 0; curRow < rows; curRow++) {
for (curCol = 0; curCol < cols; curC...
I know it's quite idiomatic, or good style at least, in C to declare numeric constants as enums instead of #defineing them.
/* bad style */
#define MAXLINE 1024
/* good/better style */
enum {
MAX_LINE = 1024
};
Is there an equivalent rule for the definition of string constants?
/* is this good style? */
#define HELLO "Hello Worl...
I'm working on a small application and thinking about integrating BLAST or other local alignment searches into my application. My searching has only brought up programs, which need to be installed and called as an external program.
Is there a way short of me implementing it from scratch? Any pre-made library perhaps?
...
In programming contests, floating point arithmetic related questions say "the error is answer must be less than 1e-6" or "The answer must be correct upto 6 decimal places". Does this mean that I can perform calculations on FP variables without worrying about the precision and only while printing I should write like
printf("%.6lf",a);
...
My colleague claims that we should dissect our C++ application (C++, Linux) into shared libraries to improve code modularity, testability and reuse.
From my point of view it's a burden since the code we write does not need to be shared between applications on the same machine neither to be dynamically loaded or unloaded and we can simpl...
What I wanted to do is take a log on battery percentage. I know the equivalent in linux is sysctl(hw.acpi.battery.life). However when I went through the man of sysctl in mac os x I did not find the equivalent code to find it. Can some one point out how to do this using objective c. I can call sysctlbyname but that doesn't have this as in...
What are the realistic outcomes of programmer bugs pertaining to pointers?
What 'bad effects' happen when programmers create pointer bugs?
Practical examples with code are preferable.
...
Why is my prof using two getchar(); at the end of our C program tutorials?
And what is the "better way" for this?
...
Could someone exactly explain the concept of extern variables in C? The declaration, exact use of extern and its scope.
...
From the Bison Manual:
In a simple interactive command parser
where each input is one line, it may
be sufficient to allow yyparse to
return 1 on error and have the caller
ignore the rest of the input line when
that happens (and then call yyparse
again).
This is pretty much what I want, but I am having trouble getting to...
Hello, I have this code:
int foo(int n)
{
int x=2;
while (x<n)
{
x = x*x*x;
}
return x;
}
Now, i need to analyze its time complexity. I noticed it reaches n much faster than just log(n). I mean, it does less steps than O(log(n)) would do. I read the answer but have no idea how they got to it: It is O(log(...
I am wondering how difficult it would be to integrate a reference counting (or other managed memory) regime for managing some of my struct libraries in C. What sample code would you recommend I look at?
...
I was recently asked about alternatives to Coverity Prevent for a code base that includes both C/C++ and Java. Obviously, on the Java side, the free tools available include Findbugs (compiled code analysis) and PMD (static code analysis). They are very powerful, especially when you start investigating integration with IDEs (which, agai...
I am trying to convert a double to a string in a native NT application, i.e. an application that only depends on ntdll.dll. Unfortunately, ntdll's version of vsnprintf does not support %f et al., forcing me to implement the conversion on my own.
The aforementioned ntdll.dll exports only a few of the math.h functions (floor, ceil, log, p...
Hello there, I'm new to programming and have been learning C for the past couple of months. I've covered most of the basics and would like to expand my knowledge. In order to get a bit more experience can you guys suggest some small projects that I can do? Things like image manipulation, gui, sending messages through the internet etc. Iv...
On my OS X 10.5.8 machine, using the regcomp and regexec C functions to match the extended regex "(()|abc)xyz", I find a match for the string "abcxyz" but only from offset 3 to offset 6. My expectation was that the entire string would be matched and that I would see a submatch for the initial "abc" part of the string.
When I try the sa...
static struct Args {
char* arg1;
unsigned arg2;
unsigned arg3;
char* arg4;
} arg;
My program saves command line args to a structure. Sometime all of the members are set... sometimes only a couple of them.
In the case where only arg1 is set, what would the best practice be to do with the rest of the members?
Thanks.
...
What's your deep comprehension of pointer,reference and Handle in C,C++ and Java?
We usually think about the pointer,reference and Handle on the specify language level, it's easy to make confusion by the newbie like me.
Actually all those concept in java, just a encapsulation of pointer.
All pointer just a encapsulation of main memory...
I'm planning to study sockets using C language, and I want to create a basic FTP client. My question is where should I start reading about FTP protocol for socket programming in C?
And could you please give some FTP library for C language. Thanks.
...